Re: [Plib-users] Matrices and sgCoord
Brought to you by:
sjbaker
|
From: Fay J. F Dr C. U. 46 S. <joh...@eg...> - 2007-07-24 15:15:07
|
Dimitris,
Hello and welcome to the PLIB community. I didn't reply to your
first request because SSG is not my strong point.
If I may ask, are you writing a trireme simulation? If so, I
invite you to look (if you haven't already) at the "Triereis" project.
It uses PLIB as well.
The question about the transformation matrix with "getSpeed" in
the bottom row instead of the last column is a tricky question for me.
Just by doing the mathematics, it seems to me that you are changing only
the "w" coordinate of the point (have you read the OpenGL "red book" on
the subject?), which would make the object move either directly towards
or directly away from the origin. Whether this is right or wrong I do
not know without further study.
John F. Fay
Technical Fellow
Jacobs Technology TEAS Group
850-883-1294=20
-----Original Message-----
From: pli...@li...
[mailto:pli...@li...] On Behalf Of Dimitris
Mexis
Sent: Tuesday, July 24, 2007 9:26 AM
To: pli...@li...
Subject: [Plib-users] Matrices and sgCoord
The following code has been a success in order to make the object move
at a constant speed.
sgCoord stigma;
void GLObject::setStigma( sgMat4 & objDst){
sgSetCoord( & stigma, objDst);
}
GLObject::move(){
//The rotation matrix for moving around trireme.
sgMat4 RotateMatrix =3D {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0,( getSpeed()), 0, 1
};
=20
sgMakeCoordMat4( SHIPSRC, &trireme->getStigma());
sgMultMat4( SHIPDST, SHIPSRC, RotateMatrix);
setStigma( SHIPDST);
What I don;t understand is that I took the usual matrix and instead
tweaking the last column element by the second row,
I inversed it and put the getSpeed() which is <>0 in the bottom row!
Why? this?
I made then the matrix multiplications, and took the result to sgCoord.
Is this right approach? Ok it works, but it worths?
=20
________________________________________________________________________
____________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
plib-users mailing list
pli...@li...
https://lists.sourceforge.net/lists/listinfo/plib-users
|