Getting Rotation From Children

Blitz3D Forums/Blitz3D Beginners Area/Getting Rotation From Children

Liberator(Posted 2005) [#1]
Hey Guys,

Today's question is how do I get the ACCURATE X, Y, or Z rotation from the child of an object?

For example, let's say I have a tank. The tank consists of 2 objects, a base (treads and whatnot) and a turret. The turret has been linked in 3dstudio to the base, and has been imported with LoadAnimMesh to ensure the links stay in tact.

What I'm looking to do is get the angle of the turret's Y axis so I can then set a 'bullet' object to that axis and have it move along a line projected from that axis. So, it should simply be a matter of saying EntityYaw(TankTurret,1). I used the 1 because I don't want how much the turret has turned in relation to the base, I want how much the turret has turned in relation to the world.

Problem is, it comes back with spratic numbers! I get 172.23 one second, rotate the tank by ONE unit to the right and I get -83.54! I used the same function on the base of the tank, and get the correct numbers. This leads me to believe it has somthing to do with the partent child relationship...but I have no idea what, or how to fix it. Unlinking the peices is out of the question as the final model will have many many peices all linked together.

Thanks for any suggestions!


flying willy(Posted 2005) [#2]
Pitch = EntityPitch(ent,1) ;< optional parameter specifies it returns the GLOBAL or REAL rotation.


flying willy(Posted 2005) [#3]
Oh yeah, if you're exporting from max, use the vastly superior b3dpipeline max plugins. www.onigirl.com/pipeline

That means multitexturing, materials, normals and vertcols are intact along with bones anims! :)