|
![](/i/fill.gif) |
Hi All,
I thought I would post this as I have noticed a couple of queries regarding
triangles and smooth-triangles. It is a set of macros that create a mesh
object using a user defined function to determine the height of each point.
It then calculates normals and creates smooth_triangles. It only calls the
height function once for each point in the grid, so is fairly efficient (and
the efficiency improves as the size of the mesh increases). Hope someone
finds it useful. The macros are documented (somewhat!) in the source.
Feel free to use the code in whatever way you wish. There is also a file
containing a set of macros I use for simple animations. This is a little
like the classic clock mod suite, but no where near as comprehensive. The
best way to figure it out is play around. I usually use it for starting and
stopping objects at different times. If you "nest" the macros, you can get
more complex actions. I intend to come back to this at some time (like after
I get the water/particle stuff working).
A couple of examples may help.
"Limit(clock,0.3,0.6)" returns a number that is 0 from clock=0 to clock=0.3,
varies from 0 to 1 when clock=0.3 to 0.6, and remains at 1 for clock > 0.6.
"Bounce(Limit(clock,0,0.5))" gives a value that goes from 0 to 1 and back to
0 as clock goes from 0 to 0.5, then stays at 0. "scale
Interp(Bounce(clock),<1,1,1>,<1,1,2>)" results in a scale that goes from
<1,1,1> to <1,1,2> and back as the clock goes from 0 to 1.
The mesh macro is also the basis of the water macros I've been working on.
This project has got a bit more complex as I decided to include drop sprays
and showers and their interaction with the surface. So it will be a little
while before it is done.
Regards
Gordon
<gbe### [at] birdcameron com au>
Post a reply to this message
Attachments:
Download 'GBSurf.zip' (4 KB)
|
![](/i/fill.gif) |