News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Euler Angle

Started by Farabi, January 14, 2012, 08:30:09 AM

Previous topic - Next topic

Farabi

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


Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

dedndave

http://en.wikipedia.org/wiki/Euler_angles

about half-way down the page, you will see 6 equations

qWord

FSQRT is missing in fGetVectorLen
FPU in a trice: SmplMath
It's that simple!

Farabi

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
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"