Orthographic view
Orthographic view
Hi I am currently working on a world hardest game clone in irrlicht. I want to implement a Orthographic view camera, but I don´t know how to achieve it. Currently I have a perspective camera but want my meshes to be facing the camera. Do someone have a example or how I can set up Orthrographic view?
Re: Orthographic view
You set your own projection matrix to the camera. But Irrlicht can create it for you.
Something like:
So first set position and target for camera. Then set how many units you want to see there (width/height/near/far).
The D3DStyle is only availabe in svn trunk (in Irrlicht 1.8 it's always true I think). So in trunk simply set it to true when you use Direct3D and false when you work with OpenGL (otherwise you get a tiny error in znear - most people won't even notice I suppose).
Something like:
Code: Select all
// Assuming you have already set position and target for camera
irr::core::matrix4 orthoMat;
orthoMat.buildProjectionMatrixOrthoLH( width,
height,
ORTHO_CAM_ZNEAR,
ORTHO_CAM_ZFAR,
D3DStyle
);
camera->setProjectionMatrix(orthoMat, true);
The D3DStyle is only availabe in svn trunk (in Irrlicht 1.8 it's always true I think). So in trunk simply set it to true when you use Direct3D and false when you work with OpenGL (otherwise you get a tiny error in znear - most people won't even notice I suppose).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm