Isometric camera
Posted: Mon May 05, 2008 5:08 pm
Hey there. Is there any way to create an isometric camera? I'm just starting using cameras and such, so I really don't know of an easy way to create a fixed isometric camera. Thanks.
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
matrix4::buildProjectionMatrixOrthoLH()Magus_Stragus wrote:Hey there. Is there any way to create an isometric camera? I'm just starting using cameras and such, so I really don't know of an easy way to create a fixed isometric camera. Thanks.
Sentence fragment.Magus_Stragus wrote:Proud member of the Online Campaign for Real English.
Code: Select all
pCamera->setIsOrthogonal(true);
You'd think, wouldn't you?aheymann wrote:does
not do the same?Code: Select all
pCamera->setIsOrthogonal(true);
Code: Select all
Find all "IsOrthogonal", Match case, Whole word, Subfolders, Find Results 1, "Entire Solution"
C:\dev\irrlicht-svn\include\ICameraSceneNode.h(32): : ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
C:\dev\irrlicht-svn\include\ICameraSceneNode.h(126): return IsOrthogonal;
C:\dev\irrlicht-svn\include\ICameraSceneNode.h(137): IsOrthogonal = orthogonal;
C:\dev\irrlicht-svn\include\ICameraSceneNode.h(142): bool IsOrthogonal;
Matching lines: 4 Matching files: 1 Total files searched: 623
Code: Select all
void buildProjectionMatrixOrthoLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
Could you please explain me a bit more about this function? I was trying to use it, but I don't know how .matrix4::buildProjectionMatrixOrthoLH()
Code: Select all
Index: include/ICameraSceneNode.h
===================================================================
--- include/ICameraSceneNode.h (revision 1412)
+++ include/ICameraSceneNode.h (working copy)
@@ -39,8 +39,10 @@
to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH.
Note that the matrix will only stay as set by this method until one of
the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.
- \param projection: The new projection matrix of the camera. */
- virtual void setProjectionMatrix(const core::matrix4& projection) = 0;
+ \param projection: The new projection matrix of the camera.
+ \param isOrthogonal: Set this to true if the matrix is an orthogonal one (e.g.
+ from matrix4::buildProjectionMatrixOrthoLH(). */
+ virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false) = 0;
//! Gets the current projection matrix of the camera.
/** \return Returns the current projection matrix of the camera. */
@@ -126,19 +128,8 @@
return IsOrthogonal;
}
- //! Sets if this camera should return that it is orthogonal.
- /** This setting does not change anything of the view or
- projection matrix. However, the kind of camera
- influences how collision detection and picking is done
- and thus can be useful to query.
- */
- void setIsOrthogonal( bool orthogonal )
- {
- IsOrthogonal = orthogonal;
- }
+ protected:
- private:
-
bool IsOrthogonal;
};
Index: source/Irrlicht/CCameraSceneNode.cpp
===================================================================
--- source/Irrlicht/CCameraSceneNode.cpp (revision 1412)
+++ source/Irrlicht/CCameraSceneNode.cpp (working copy)
@@ -70,8 +70,9 @@
//! Sets the projection matrix of the camera. The core::matrix4 class has some methods
//! to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH
//! \param projection: The new projection matrix of the camera.
-void CCameraSceneNode::setProjectionMatrix(const core::matrix4& projection)
+void CCameraSceneNode::setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal)
{
+ IsOrthogonal = isOrthogonal;
ViewArea.Matrices [ video::ETS_PROJECTION ] = projection;
ViewArea.setTransformState ( video::ETS_PROJECTION );
}
Index: source/Irrlicht/CCameraSceneNode.h
===================================================================
--- source/Irrlicht/CCameraSceneNode.h (revision 1412)
+++ source/Irrlicht/CCameraSceneNode.h (working copy)
@@ -25,10 +25,15 @@
//! destructor
virtual ~CCameraSceneNode();
- //! Sets the projection matrix of the camera. The core::matrix4 class has some methods
- //! to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH
- //! \param projection: The new projection matrix of the camera.
- virtual void setProjectionMatrix(const core::matrix4& projection);
+ //! Sets the projection matrix of the camera.
+ /** The core::matrix4 class has some methods
+ to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH.
+ Note that the matrix will only stay as set by this method until one of
+ the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.
+ \param projection: The new projection matrix of the camera.
+ \param isOrthogonal: Set this to true if the matrix is an orthogonal one (e.g.
+ from matrix4::buildProjectionMatrixOrthoLH(). */
+ virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false);
//! Gets the current projection matrix of the camera
//! \return Returns the current projection matrix of the camera.