Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Nov 2012
Offline Last Active Nov 02 2013 07:21 PM

Posts I've Made

In Topic: glPopMatrix does not get what was pushed

08 October 2013 - 08:14 AM

I am Sorry.

It was my mistake :

I had one glPushMatrix in excess elsewhere in the code. So at the end of each frame, I had a matrix forgotten in the stack.

and at the 32nd frame, the matrix poped no longer corresponded to the one immediately pushed.



I guess openGL should signal the overflow in the matrix stack by a crash or a warning, rather than poping an incorrect matrix.  



Thank you for your answer and your time


In Topic: Quaternions concatenation is the sum of angles ?

28 November 2012 - 09:21 AM

I found out my error when I was trying to write my respond explaining that I am doing nothing wrong !

My product operator expects a quaternion class constructor with the W component as a first parameter.
While the available constructor expects an angle as the first parameter.

HQuaternion HQuaternion::operator*(HQuaternion & q)
return HQuaternion(
w*q.w - v.Dot(q.v),HVector3(q.v*w + v*q.w + v.Cross(q.v) )
HQuaternion::HQuaternion(double angle, HVector3 & _v):v(_v)
double angleover2 = angle/2;
double c = cos(angleover2);
double s = sin(angleover2);
v *= s;

Thank you for your responses and for the link

In Topic: Quaternions concatenation is the sum of angles ?

28 November 2012 - 08:43 AM

Oh! Yes, you are right.
I was thinking of my code while writing the email.
Because my code looks like :

HQuaternion q1(PI_over_8,HVector3(1,0,0));
HQuaternion q2(PI_over_8,HVector3(1,0,0));
HQuaternion r1=q1*q2;
HQuaternion q3(PI_over_4,HVector3(1,0,0));
assert(r1 == q3);

Please respond my second email "Quaternions concatenation is the sum of angles ? (2)"

Thank you