Posted: 13th Jun 2007 5:34
In my game, one of the characters has heat vision and im trying to make it so when you beam certain objects, they melt. I used vertexdata to achieve this effect, and it looks alright... Here is the function I'm using, does anyone have any suggestions on how to make this function look better? (without having to go back and animate all of my scenery objects)

+ Code Snippet
make object sphere 1,10
sync on: sync rate 40
do
   meltob(1)
   sync
loop

function meltob(o)
   perform checklist for object limbs o: totl = checklist quantity() - 1
   rx# = rnd(200) - 100
   ry# = rnd(200) - 100
   rz# = rnd(200) - 100
   for l = 0 to totl
      lock vertexdata for limb o, l
      vtot = get vertexdata vertex count()
      for v = 0 to vtot
         x# = get vertexdata position x(v)
         y# = get vertexdata position y(v)
         z# = get vertexdata position z(v)

         x# = x# + (0-cos(x#*30 + rx#)*.02)
         y# = y# + (0-sin(y#*30 + ry#)*.02)- abs(y#)*.001
         z# = z# + (0-cos(z#*30 + rz#)*.02)
         set vertexdata position v,x#,y#,z#
      next v
      unlock vertexdata
   next l
endfunction


Or am I going about this the wrong way? Would a combination of scaling and a cool shader work out better?
Posted: 13th Jun 2007 15:12
Wow, thats a freaky effect I love how it wobbles.

I probably would have just used

scale object objNum,wider,lower,wider

it might solve the problem of everything mellting into a triangle.

i dunno if it would look right maybe use your vertex manipulation to spread out the lower parts first to make it look like it's melting into a puddle?