Change up vector in Irrlicht

138 views
Skip to first unread message

Giovanni Mottola

unread,
Apr 28, 2017, 11:18:30 AM4/28/17
to ProjectChrono
Dear all,
I have a Chrono project with an Irrlicht application. I would like to be able to control the position and orientation of the camera for the said application.
I'm currently using this:
vector3d<f32> camera_loc = vector3df(0, 0, 20); // camera location
vector3d<f32> camera_dir = vector3df(0, 0, 0); // "look at" location
appl_CSPR->AddTypicalCamera(camera_loc, camera_dir);
This works fine, but in this way I'm only setting the position camera_loc of the camera and the point camera_dir towards which the camera is looking. 
To completely define the camera orientation, one also needs to specify how the camera is rotated along its axis (the one going from camera_loc to camera_dir).
For this I would have to define the "up" vector, that is, the direction that is shown in the upper part of the application window.
This cannot be done with AddTypicalCamera, though. The program automatically assumes that the up vector is along the Y axis and I can't find a way to change this setting.

Is there any way to do this?

Best regards,
Giovanni Mottola

Giovanni Mottola

unread,
May 4, 2017, 4:43:42 AM5/4/17
to ProjectChrono
On a similar note, I'm also struggling with disabling perspective. From the documentation I see that ChCamera::SetOrthographic should be used, but I can't find an example.
Any suggestions?

Best regards,
Giovanni Mottola

Alessandro Tasora

unread,
May 6, 2017, 3:04:22 PM5/6/17
to projec...@googlegroups.com
Dear Giovanni,

if you look at the forums on the Irrlicht website, you find that there are =
ways to adjust Irrlicht camera to orthographic view using directly the Irrl=
icht functions (probably the Chrono function ChCamera::SetOrthographic work=
s only if you output to POVray, something that I'd suggest you if you need =
better 3d rendering - look at the demos for the POSTPROCESSING unit - if yo=
u havent' built it, just enable it in CMAKE).

Note that Irrlicht also has the issue that the view is mirrored on X axis.

Alessandro
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To post to this group, send email to projec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages