The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Farabi on January 14, 2012, 08:30:09 AM

Title: Euler Angle
Post by: Farabi on January 14, 2012, 08:30:09 AM
Is it posible to have the euler angle from a rotation matrix? Im stuck thinking about it.

This is the only clue I had.


; +,+ = 0-90
; +,- = 90-180
; -,- = 180-270
; -,+ = 270-360


fGetVectorLen proc uses esi edi lpV:dword

mov esi,lpV

fld [esi].VERTEX.x
fmul [esi].VERTEX.x
fstp [esi].VERTEX.x
fld [esi].VERTEX.y
fmul [esi].VERTEX.y
fstp [esi].VERTEX.y
fld [esi].VERTEX.z
fmul [esi].VERTEX.z
fstp [esi].VERTEX.z

fld [esi].VERTEX.x
fadd [esi].VERTEX.y
fadd [esi].VERTEX.z


ret
fGetVectorLen endp


invoke Vec_Sub,addr vR,lpfPos,addr VPosa ; Vector subtraction, from the Delta, we will determined is what is the euler angle.
invoke fGetVectorLen,addr vR


Title: Re: Euler Angle
Post by: dedndave on January 14, 2012, 11:08:24 AM
http://en.wikipedia.org/wiki/Euler_angles

about half-way down the page, you will see 6 equations
Title: Re: Euler Angle
Post by: qWord on January 14, 2012, 12:51:07 PM
FSQRT is missing in fGetVectorLen
Title: Re: Euler Angle
Post by: Farabi on January 14, 2012, 02:23:52 PM
Quote from: qWord on January 14, 2012, 12:51:07 PM
FSQRT is missing in fGetVectorLen

Oh, youre right, Im clumsy again. ThanksĀ  :U
I never done something when Im alone.

I should be able to extract the euler angle degree information if I used atan on a 2D coordinate, but I dont know is it posible on 3D equations.

It should be
X=dX/len
Y=dY/len
Z=dZ/len