Page 1 of 1

camera rotation problem (model post fixed)

Posted: Fri Mar 16, 2007 10:43 pm
by Strong99
I tried to rotate a model, with the rotate.Y everythings fine, but when i use the X rotation after -68 the model mirrors himself instead of rotating farther

Posted: Sat Mar 17, 2007 12:46 pm
by c.h.r.i.s
Hi! can you post the code in here?

Posted: Sat Mar 17, 2007 1:20 pm
by Strong99

Code: Select all


irr::core::vector3df rot = node->getRotation();
rot.X -= 1;
node->setRotation(rot);

smgr->beginScene(true,true,video::SColor(255,255,255,255));
   Device->getSceneManager()->drawAll();
smgr->endScene()

everythings go well until X < -70 or X > 190
i use an X model

Posted: Sat Mar 17, 2007 1:44 pm
by c.h.r.i.s
Hi! I think "X < -70 or X > 190" is not the problem. All works fine if i try it. (x<-5000 and x > 5000).

I think the problem is another. Is there another function that will change properties of "node"?

And what do you mean with "mirrors himself"? Do you see the model twice?

Posted: Sat Mar 17, 2007 1:49 pm
by Strong99
no, the model looks like it rotate 90 on the Y but its actualy mirrord

no, nothing calls him, i'm using irr 1.2

Posted: Sat Mar 17, 2007 1:53 pm
by Strong99
even if i parent him on a FPS camera it hapens, when i go under X < -70, the model mirrors but the came still rotate ok.

Posted: Sat Mar 17, 2007 4:31 pm
by Strong99
I found the real problem. The camera was attachd to it annd when the camera came under -70 it hit the max angle and the camera inverted instead of model. But how to fix?

because the the camera has a target and don't follow its models rotation

Posted: Sat Mar 17, 2007 4:50 pm
by Strong99
I need the camera to rotate with the object instead using setTarget, Settarget woun't follow and because of that he takes the shorest route,

i want this:
the red line indicates the upper border of the scene, the upper image strip shows that the camera moves along and the upper corner gets the lower than the bottom of the screen so the camera rotate with me.

But the second example happens. (bottom image strip);

the upper border of the scene stays the upper, it won't rotate with me

Image

Posted: Mon Mar 19, 2007 2:38 am
by vitek
You need to set the up vector if you want the camera to go upside down.

Posted: Mon Mar 19, 2007 2:17 pm
by Strong99
i noticed that it occurse at rotation X > 55 and rot X < 125,

so i did

Code: Select all

if (rot.X > 55 && rot < 125)
   camera->setUpvector(0.0f,-1.0f,0.0f);
it changes on the good values but nothing change ( i did a check)

[EDIT]
Ah, it resets himself i need to set it every time and then setTarget
thanks