1161

**Zelda Projects / Re: [WIP] LOZ 3D**

« **on:**April 30, 2009, 02:32:52 pm »

Not sure how to animate Bow-Wow's chain-limited movement properly.. Suggestions would

be great :-)

Just a little comment that might or might not help.

I'm not familiar with 3d techniques, but it shouldn't be too hard to solve it. In 2d I would just make a Bow-Wow with a limited movement area and a routine to create the chain in between the Bow-Wow and the origin coordinates. The movement limitation should be doable through a stepwise routine that checks if it's about to leave it's area.

The chain could be done by creating an x number of chain pieces. Calculate the line between Bow Wow and it's origin and spread the pieces equally along the line. You'll get open spaces if you do this when the Bow Wow is far away, but then again that might be not be that bad. Gives you a exaggerated sense of the distance and it limits the number of objects used. To negate this just make the number of pieces linearly dependant on the distance.

---------------

Update: I was thinking. You could go one or two steps further.

To create the effect of the chain hanging towards the ground you could use a hyperbolic formule. Consider the line between Bow Wow and origin as the x-axis. Now use the formule y = x ^ (-i), where y is the height on top of the line's height, where x is the distance along the line with x=0 at the middle and where i is a positive variable based on the distance between Bow Wow and its origin. When the chain is fully stretched i should be 0 resulting in a straight line.

With this you can calculate the height for each chainlink. Just use the formule at certain intervals to calculate. The angle of each link could be calculated by the use of the Pythagoras formule.

If you want you could go even farther. You now have calculations based on a straight line between your Bow Wow and it's origin, but that's only for calculating. If want the chain to lie on the ground in a (somewhat) realistic method only use the above method to calculate height and angle for your chain links using the full chain's length as x and the actual distance to Bow Wow as a bases for i. The x and y location on the ground (per chain link) could then be separately determined based on Bow Wow's previous positions and movement. Or, if you want to make it really complex use the origins movemens as well.

It can be made as realistically as you want it to be. All it takes is logic .... plus LOTS of trail and error and efficiency tradeoffs.