bend a mesh

Blitz3D Forums/Blitz3D Beginners Area/bend a mesh

ryan scott(Posted 2006) [#1]
if i have a tree in my game and i want it to go 'boing' and sway back and forth when it gets hit, is there a generic mesh altering routine that can do that, or should i be doing an animation in Max and triggering those animations instead?

since i want it to boing in any of 4 directions (which allows it to be hit from 8 sides and look like its boinging in the right direction, i would need 4 animations per tree, is that right?

a little new at all this

thanks


mindstorms(Posted 2006) [#2]
you could mess with the vertexes, but for what you are doing it would have to be written by you and would take a lot of time. I would use animations.


Matty(Posted 2006) [#3]
I would say you are better using animations for the following reason:

If you have many trees, using copy entity to create them from a 'master mesh' then if you alter the 'master mesh' you will cause all copies to bend as well. - You would need to have each tree as a 'mesh' to bend each one.

However you don't need to necessarily use animations or mesh commands. If you create a bone structure for the tree then you can alter the bone orientations in code as desired. This would allow for much more flexible animations rather than having a preset animation sequence the tree goes through. Each bone can be found using the 'getchild' command and then treated like a regular entity - ie you can use rotate, turn, position and other similar entity commands on the bone.