## Thursday, December 6, 2012

### Area Autodesk feature.......

We got mentioned on autodesk \:D/

I did a brief Tutorial on the setup of feathers we used in Khumba, this is still very much a work in progress :D

hardware render of that setup ......

If you want to download these nodes to try them out, go to Triggerfish and click on the feather icon on the page.

## Monday, December 3, 2012

### Triangle Area...

Continuing on with the calculating of area... lets look at triangles.
There are tons of ways to get the area of a triangle so.....

Here is a link to wikipedia's section on Triangles .

I went with Heron's Formula, simply because I had all the edge/side lengths worked out already. Here is what my scene looks like...

 *click to make bigger*

I drew a linear curve with three points for my triangle.

The black value(area=√( s(s-a)(s-b)(s-c) )) is the area of the triangle, the orange value(cos C = (a^2 + b^2 - c^2)/2ab) is the corner angle of Point_02_Null. The light green value(s = (a+b+c)/2) is half the length of the perimeter of the triangle.

Lets go look at all this in ICE.

To start I made a little cluster to null constraint so I could move the triangle points around freely. I named them Point_01_Null, Point_02_Null and Point_03_Null. *something to keep in mind is that one of your points will be numbered 0, and be on 0,0,0. I just moved mine off the origin. In the wikipedia they go into a whole section on this.*

Here's what that constraint looked like in ICE.

Then I worked out the length and center of the three sides.

Side A, B and C letters where stuck too the curve by a standard Softimage constrain between two points.

Using a linear blend between the two nulls was the fastest why to get the center point on the curves

Using the distance between node, I got all three sides lengths and then added them together to get the perimeter of the whole triangle.

Here's what the inside of the compound "length of C" looks like....

Next I tested the side lengths with the curve length to see if the perimeters matched up.

Now I could work out the angles of the triangle using the law of cosin:

cos C = (a^2 + b^2 - c^2)/2ab

Here's what the ICE tree looks like...
*note I had the to use ArcCos to get the right answer*

Last I worked out the Area of my triangle using Herons Formula.

This formula has two parts to it, the first being:
(s = (a+b+c)/2   which gets half of the perimeter, and then
area=√( s(s-a)(s-b)(s-c) ) which uses the value s to work out the area.

Here's what those two sums look like....

Taking the ready made side lengths(A, B and C) and subtract the value s from them. Multiply those answers with the value s. Then all thats left is to get the square root of that and you have the area of the triangle.

END :D

## Thursday, November 22, 2012

### Square Area....

 *click to make bigger*

#### Definition:

A Square is a flat shape with 4 equal sides and every angle is a right angle (90°) and opposite sides are parallel.

#### Diagonals...

A square has two diagonals, they are equal in length and intersect at the middle point.

The Diagonal is the side length(a) times the square root of 2:
*side length = a = the length between A and D* (see image at top)

Diagonal "d" = a × √2

#### Perimeter...

The Perimeter is 4 times the side length:

Perimeter "p" = 4a

#### Area...

The Area is the side length squared:

Area = a2 = a × a

....or half of the diagonal squared:

Area = d2/2

### What this looks like in ICE ....

#### Side length

To work out the side length of the square shown below.....

..... Subtract the corner point (-1,-1,0) with corner point (-1,1,0). Then simply get the length of the vector between the them.

#### Perimeter

The light green perimeter value is worked out with the math sum shown below, while the darker green value shows the curve length attribute in ICE, they are both the same.

p = 4.a

#### Diagonal

The diagonal length as shown by the blue value below was got by....

d = a .  √2

#### Area

Area can be calculated two ways, by multiplying the side lengths or by the diagonal....

..... here are what those calculations look like in ICE.

## Wednesday, November 14, 2012

### Underwater fur . . .

#### First step find reference of animals underwater

Never underestimate the power of reference, here is some I used...

Here is some video reference of a tiger underwater.....

.....I also looked at Ink in water.

After watching the reference many times, I decided to break up the "underwater effect" into five different areas....

1. Force of movement from the object
2. Wave motion through hair when the object moves
3.  Water movement and direction
4.  Other objects making the water move for example the paw of the tiger
5.  Over all Puff

#### Demo Scene

In my little demo scene for this blog post I'm going to touch on some of the ways I got around these problems. Obviously it includes tons of things I learned from tutorials and other resources. I'm not going to go into to much detail. Honestly I don't know if this is the best way to make under water fur effects, lets just say it worked for me :D Here's a Capture of the demo scene....

### Break down of Scene

There is an over all modulate by null in this scene - Box null - , so that it looks like the sphere is entering the water, and leaving it again. Also all the effects are in the modeling stack in ICE. None of the effects are in the "Simulation stack".

#### Step One: "Force of movement" made with the following ICE Trees

Create an none simulated ICE tree in the modeling stack. Then get the point velocity from the emitter using the get closest location node, then apply that point velocity value to all the points in the strand. This way we get a strand velocity value for each point on the strand.

Then I apply the Velocity as a "force", and vary it with the mass of the strands.

#### Step two: I made the following ICE trees for the wake.

The wake was just added to the "force" of the velocity.

The wake is a simple sin function that takes the global position into account. I added a random around value to the amplitude to get it to be less repetitive.

#### Step three: The following ICE Trees are for water direction and movement.

To start off, watch this tutorial by Paul Smith
Vector Flow

So now that you have a feel for vector flow, I used the vector flow of a bunch of curves the represented the "waters" flow direction. This is all still in the modeling stack.

Here are the curves I made for this scene.... to create variation of motion in the water I just animated the curves to rotate around their local orientation.

#### Step Four: Other objects making the water move

Here I have the strands push away from a Null object. I modified the modulate by null to take into account the strand position of the strands.

#### Step Five: Puff

The puff is just a simple push along the Y axis of the strands to add the illusion of weightlessness.

Nice thing about doing the "under water effect" in the modelling stack is... I could step through my scene without having to wait for a simulation bar to calculate. And because of the curves I could change the way the water effected the fur on frame 60 but have frame 5 be uneffected. Which is really nice and flexible and feels more like animating then simulating. :D

## Circles....

 Hula Hoop
 The definition of a circle is:
The set of all points on a plane that are a fixed distance from a center.

 *click too make bigger*

The Radius is the distance from the center to the edge.
The Diameter starts at one side of the circle, goes through the center and ends on the other side.
The Circumference is the distance around the edge of the circle.
The Chord is a line segment whose endpoints lie on the circle.
The Tangent is a straight line that touches the circle at a single point.

When you divide the circumference by the diameter you get 3.141592654...
which is the irrational number π (Pi)

thus :
Circumference = π × Diameter
Diameter π × Circumference

To get the area of a circle you need either the radius or the diameter and π .

The area of a circle is π times the radius squared, which is written:
A = π × r2
Or, in terms of the Diameter :
A = (π/4) × D2

A circle has about 80% of the area of a similar-width square.
The actual value is (π/4) = 0.785398... = 78.5398...%

#### Lets look at this in ICE

I created a normal circle in Softimage with a radius of 1, and a subdivision count of 16.

 *click too make bigger*
The ICE attributes on a circle are quite limited, it pretty much only gives you the curve length. So if you want to know say... the area of the circle you will have to work it out for yourself. Here is how I got some of the values I wanted to know.

π (Pi)

To get π I used the attribute curvelength (circumference) divided with the diameter (Got the distance between two opposite points on the circle).

 *click too make bigger*

....you can see from the image below that got me the right value.

 *click too make bigger*

R = Diameter/2

 *click too make bigger*
 *click too make bigger*

#### Area

The Blue value is area worked out with diameter and the Green value is area worked out with the radius.

 *click too make bigger*
They both get the same result.....

 *click too make bigger*

Circumference

The Purple value is worked out with the Math in the ICE tree below, where as the green value is the curve length given by the ICE attribute in Softimage.

 *click too make bigger*
They are both the same...

 *click too make bigger*

Diameter

Calculating Diameter using the math sum :
D = r . 2

 *click too make bigger*

 *click too make bigger*

### Unit Circle

.....this is a really fun way tho see how a circle is a set of points that are a fixed distance from a center.