|
Post by Naevius on Feb 6, 2005 19:43:53 GMT 1
It seems that, when Newton takes care of the rotation of an object, when you get the rotation of the object with the DBP command "object angle x/y/z" the angles go from a range of -90 to 90 when they're supposed to go from 0 to 360 in a normal DBP enviroment. You can imagine how frustrating it is since you can't get a lot of DBP commands to work (the "set camera to follow" for example)
|
|
|
Post by Kjelle69 on Feb 7, 2005 11:44:45 GMT 1
yup. welcome to the world outside DBPro. there are about 1,000,000 websites out there that can explain your problem better than I can... but the basic idea is that internally all 3D engines use rotation Matrices to represent the orientation of objects, *not* 3 angles. anyway, DBPro hides this from you pretty well. however when you add something like Newton into the mix, you don't get those nice, "clean" angles you're used to. trust me, the angles it returns a accurate, and represent the orientation of the object perfectly, they're just not intuitive to the human brain have a look at the "EZRotate" addon for DBPro, written by Wolf (it's on the TGC site)... it explains the problem you're having (and also provides a solution).
|
|
|
Post by Naevius on Feb 7, 2005 19:23:17 GMT 1
Ok, got a look at ezrotate and you have to purchase it...no money though ....so don't you have any other site that can explain me how can I turn those "matrices rotations" into DB angles? Thanks in advance Naevius
|
|
|
Post by Kjelle69 on Feb 8, 2005 2:22:09 GMT 1
that's what the "NDB_BodyGetRotation" command is doing. it turns the matrix data into 3 angles. however, because it's a general way of converting into angles, the angles are right, but they may not be easy to understand.
|
|
|
Post by Naevius on Feb 10, 2005 22:10:30 GMT 1
nope, the command is giving me the exact same values of the "object angle x/y/z"...
|
|
|
Post by Kjelle69 on Feb 11, 2005 3:51:53 GMT 1
yeah, because that's what DBPro's "object angle" command does too. it takes the internal "hidden" object matrix, and turns it into 3 angles for you.
the problem comes when Newton rotates the objects for you, it changes the matrix (to rotate the object), and thus the resulting angles also change. they just don't change in an intuitive way. but I promise, they're right.
|
|
|
Post by Naevius on Feb 11, 2005 10:50:04 GMT 1
Hmmm, ok...I'm sure the angles are right(because my object rotates perfectly). The fact is that if I have to get the rotation of it, the values that Newton gives me are not compatible (hope that's a word) with DBPro. So, if I have a non Newton object that I wish to have the same rotation of a Newton object, I can't do it, beacuse if I give to the non Newton object the values I get from the Newton object the non Newton object acts strangely(it rotates well for about 180 degrees and then it rotates bacwards...or something like that...). Please help me. I really got stuck with this problem. Thanks
|
|
|
Post by Kjelle69 on Feb 11, 2005 10:57:16 GMT 1
okay... what exactly are you trying to do?
|
|
|
Post by Naevius on Feb 11, 2005 11:08:13 GMT 1
Ok, here is what I have to do: I've got this spaceship that I control with addomega and addforcelocal. I wanted to put a camera behind it like a 3d person camera using set camera to follow command(dunno if you remember it, since you're using ogre now ;D). Obviously I can't since I can't get the right angles for DBP from the spaceship. I however got the problem solved (every cicle I move the spaceship bacwards and position there the camera and then reposition the spaceship before sync so the movement doesn't appear) but I don't think I want to, everytime I have to get the rotation of a Newton object, study a different solution to achieve what I wanted to do. Hope I was clear enough. Thanks Naevius
|
|
|
Post by Kjelle69 on Feb 11, 2005 11:13:00 GMT 1
okay, try this:
let's assume you want the camera to always be offset from the camera with a value of (0,10,-20).
try this:
NDB_NewtonBodyGetMatrix ShipBody NDB_SetVector 0.0, 10.0, -20.0 NDB_TransformVector 1
position camera NDB_GetVector_X(), NDB_GetVector_Y(), NDB_GetVector_Z()
NDB_BodyGetPosition ShipBody point camera NDB_GetVector_X(), NDB_GetVector_Y(), NDB_GetVector_Z()
|
|
|
Post by Save all on Oct 9, 2005 21:58:26 GMT 1
Necessary of an example of "set camera to follow" for "demo12 - Simple Vehicle without
measured Tutorial" with the DLL "EZrotate"!
Debtor for the attention!
|
|
aaa11
Newton Scholar
Posts: 117
|
Post by aaa11 on Sept 18, 2008 4:11:58 GMT 1
|
|
|
Post by wowposter on Nov 8, 2008 13:52:02 GMT 1
|
|