Im trying to rotate my model with no lucky.
I've tried using two ways:
Using "glRotatef(gDrawRotateAngle, 0.0f, 1.0f, 0.0f);". It makes the model rotate, but it rotates until get out of the screen and get back in the other side. Using glRotatef doesn't works well in Release 1.0 neither Release 2.0
The following code works in Release 1.0, but doesn't in Release 2.0
in ARView.m method drawView I've added:
- Code: Select all
float *currentPose;
float newPose[16];
currentPose = [arViewController.virtualEnvironment objectPose:0];
EdenMathRotateMatrix(newPose, currentPose, DTOR*gDrawRotateAngle, 0.0f, 1.0f, 0.0f);
[arViewController.virtualEnvironment setObjectPose:0 matrix:newPose];
in VirtualEnvironment I've added:
- Code: Select all
- (void) setObjectPose:(int)objectIndex matrix:(float *)T{
memcpy(((VEObject*)[objects objectAtIndex:objectIndex]).pose.T, T, sizeof(float) * 16);
}
- (float *)objectPose:(int)objectIndex {
return (((VEObject*)[objects objectAtIndex:objectIndex]).pose.T);
}
any hint?
Thanks in advanced,
Noel