Re: [Plib-users] Matrices and sgCoord
Brought to you by:
sjbaker
From: Dimitris M. <dm...@ya...> - 2007-07-24 18:26:48
|
>Dimitris,=0A=0A> Hello and welcome to the PLIB community. I didn't rep= ly to your=0A>first request because SSG is not my strong point.=0A=0AThank = you for the invitation in the PLIB community, and please tell me if by repl= ying to plib-users list I am ok with proper responding in the list.=0A=0A= =0A> If I may ask, are you writing a trireme simulation? If so, I=0A>invi= te you to look (if you haven't already) at the "Triereis" project.=0A>It us= es PLIB as well.=0A=0AEhm...In deed I am writing a game for trireme warfare= , but it is not a simulation exactly, and I haven't started now. It's going= to be something like Pirates.=0AI did saw the project days ago(triereis), = but i didn't see any code.=0ALast I can't abandon Methos, it's an old proje= ct of me and it is a dream I wish to finish it up.=0A=0A=0A=0A> The ques= tion about the transformation matrix with "getSpeed" in=0A>the bottom row i= nstead of the last column is a tricky question for me.=0A>Just by doing the= mathematics, it seems to me that you are changing only=0A>the "w" coordina= te of the point (have you read the OpenGL "red book" on=0A=0AWhat exactly s= hould I read ? I have the red book borrowed from my uni, about 1.4 opengl.= =0ACan you give me a hint ? If i must look sth specifically...?=0A=0A>the s= ubject?), which would make the object move either directly towards=0A>or di= rectly away from the origin. Whether this is right or wrong I do=0A>not kn= ow without further study.=0A=0AWell neither do I feel strong in math :-) an= d I don't really know if it's right as algorithm...But it should as matrix = multiplication be workable enough.=0AIf you compile the code, you may see t= he results...Funny ones...=0A=0A>John F. Fay=0A>Technical Fellow=0A>Jacobs = Technology TEAS Group=0A>850-883-1294 =0A=0A-----Original Message-----=0AFr= om: pli...@li...=0A[mailto:plib-users-bounces@l= ists.sourceforge.net] On Behalf Of Dimitris=0AMexis=0ASent: Tuesday, July 2= 4, 2007 9:26 AM=0ATo: pli...@li...=0ASubject: [Plib-use= rs] Matrices and sgCoord=0A=0AThe following code has been a success in orde= r to make the object move=0Aat a constant speed.=0A=0AsgCoord stigma;=0A=0A= void GLObject::setStigma( sgMat4 & objDst){=0A sgSetCoord( & stigma, obj= Dst);=0A}=0A=0AGLObject::move(){=0A //The rotation matrix for moving aro= und trireme.=0A sgMat4 RotateMatrix =3D {=0A 1, 0, 0, 0,=0A = 0, 1, 0, 0,=0A 0, 0, 1, 0,=0A 0,( getSpeed()), 0, 1=0A = };=0A =0AsgMakeCoordMat4( SHIPSRC, &trireme->getStigma());=0AsgMultMat4= ( SHIPDST, SHIPSRC, RotateMatrix);=0AsetStigma( SHIPDST);=0A=0AWhat I don;t= understand is that I took the usual matrix and instead=0Atweaking the last= column element by the second row,=0AI inversed it and put the getSpeed() w= hich is <>0 in the bottom row!=0AWhy? this?=0AI made then the matrix multip= lications, and took the result to sgCoord.=0AIs this right approach? Ok it = works, but it worths?=0A=0A=0A=0A=0A=0A =0A__________________________= ______________________________________________=0A____________=0ANeed a vaca= tion? Get great deals=0Ato amazing places on Yahoo! Travel.=0Ahttp://travel= .yahoo.com/=0A=0A----------------------------------------------------------= --------------=0A-=0AThis SF.net email is sponsored by: Splunk Inc.=0AStill= grepping through log files to find problems? Stop.=0ANow Search log event= s and configuration files using AJAX and a browser.=0ADownload your FREE co= py of Splunk now >> http://get.splunk.com/=0A_____________________________= __________________=0Aplib-users mailing list=0Ap...@li...urceforge= .net=0Ahttps://lists.sourceforge.net/lists/listinfo/plib-users=0A=0A-------= ------------------------------------------------------------------=0AThis S= F.net email is sponsored by: Splunk Inc.=0AStill grepping through log files= to find problems? Stop.=0ANow Search log events and configuration files u= sing AJAX and a browser.=0ADownload your FREE copy of Splunk now >> http:/= /get.splunk.com/=0A_______________________________________________=0Aplib-u= sers mailing list=0Ap...@li...=0Ahttps://lists.source= forge.net/lists/listinfo/plib-users=0A=0A=0A=0A=0A=0A =0A____________= ________________________________________________________________________=0A= Pinpoint customers who are looking for what you sell. =0Ahttp://searchmarke= ting.yahoo.com/ |