Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Transformation matrices in DGDK.NET

Author
Message
thierry st malo
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 17th Jan 2008 10:43
Hi, all,

I have problems with transformation matrices in DGDK.NET .
Let's say I want to rotate on itself an object with world coordinates stored in a 3D structure (P) and using rotation angles stored in another 3D structure (TR1). Here is the code:

With oDBMath
.RotateYPRMatrix4(Matrix, TR1.AY, TR1.AX, TR1.AZ)
.SetVector3(Vector1, P.X, P.Y, P.Z)
.TransformCoordsVector3(Vector2, Vector1, Mat)
P.X = .XVector3(Vector2)
P.Y = .YVector3(Vector2)
P.Z = .ZVector3(Vector2)
End With

Whatever values are stored in P and TR1, P's all three coordinates are always set to zero! How come? Something escapes me, but what? I have tried with Vector4s having W set to 1.0, same thing.
Thanks,
Thierry
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 17th Jan 2008 11:05
You are using different matrix than which you are actually setting up

.RotateYPRMatrix4(Matrix, TR1.AY, TR1.AX, TR1.AZ)
.TransformCoordsVector3(Vector2, Vector1, Mat)
thierry st malo
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 17th Jan 2008 14:45
Oh, my God! I've been making an ass of myself again!
Actually that code comes from a Sub, and Matrix and Mat have the same value (default parameters, you know).
Sorry about that; my question still stands.
Thierry

Login to post a reply

Server time is: 2024-10-08 15:58:21
Your offset time is: 2024-10-08 15:58:21