Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 425 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
quaternion from entity pan tilt roll #374169
06/16/11 06:13
06/16/11 06:13
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
I'm trying to produce a quaternion rotation from an entity's pan tilt roll parameters in a dll...this is what im trying so far... doesn't quite work as orientations are wrong. I need this for a D3DXMatrixTransformation matrix...

D3DXQuaternionRotationYawPitchRoll
(
&qrot,
D3DXToRadian(_FLOAT(ent->pan)),
D3DXToRadian(_FLOAT(ent->tilt)),
D3DXToRadian(_FLOAT(ent->roll))
);


Sphere Engine--the premier A6 graphics plugin.
Re: quaternion from entity pan tilt roll [Re: Matt_Aufderheide] #374180
06/16/11 08:13
06/16/11 08:13
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
You don't need quaternions here: Use ang_to_matrix for getting a D3DX transformation matrix.

For converting an angle to a quaternion, you can either use a DirectX function, or use vec_cross to get the rotation axis and the angle about that axis. At least that's the theory, I haven't done it yet.

Re: quaternion from entity pan tilt roll [Re: jcl] #374286
06/16/11 22:46
06/16/11 22:46
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
ok, ang_to_matrix works for what i want... thanks.


Sphere Engine--the premier A6 graphics plugin.

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1