DemoApplication camera control

Post Reply
yamasaki
Posts: 7
Joined: Mon Apr 01, 2013 2:32 am

DemoApplication camera control

Post by yamasaki »

Hi, all.
I want to control the initial camera position (and gaze point, up vector) in the derived class of DemoApplication.
In other words, I want the function like gluLookAt in my DemoApplication.
So, I wrote the following code in initPhysics, but it does not work. How should I change my code?

Code: Select all

m_cameraPosition = btVector3(eyeX, eyeY, eyeZ);
m_cameraTargetPosition = btVector3(gazeX, gazeY, gazeZ);
m_cameraUp = btVector3(upX, upY, upZ);
this->resetPerspectiveProjection();
Thanks in advance.
laadams85
Posts: 18
Joined: Wed May 22, 2013 1:45 pm

Re: DemoApplication camera control

Post by laadams85 »

It would help if you describe the behavior that you would like to get, and the actual behavior you are getting.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: DemoApplication camera control

Post by Flix »

I don't remember exactly right now, but I think there are two member values (called m_ele and m_yaw, or something like that) that you can use to change the camera view axis... I'm not sure if these can solve your issue, but I suggest you play with these values too...

PS: maybe thre's some m_cameraDistance field too (I don't remeber right now).
Post Reply