Isometric camera
-
- Posts: 86
- Joined: Wed Aug 29, 2007 10:45 pm
Isometric camera
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.
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Isometric camera
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.
ICameraSceneNode::setProjectionMatrix()
Sentence fragment.Magus_Stragus wrote:Proud member of the Online Campaign for Real English.
Last edited by rogerborg on Tue May 06, 2008 6:48 am, edited 1 time in total.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
does
not do the same?
Code: Select all
pCamera->setIsOrthogonal(true);
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
You'd think, wouldn't you?aheymann wrote:does
not do the same?Code: Select all
pCamera->setIsOrthogonal(true);
Unfortunately:
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
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
It's a method of matrix4.
I'm assuming that by isometric camera you mean one that doesn't have perspective effects. That's an orthographic camera, which in turn is just a camera with an orthographic (rather than perspective) projection matrix.
Code: Select all
void buildProjectionMatrixOrthoLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 86
- Joined: Wed Aug 29, 2007 10:45 pm
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()
Ah, and thanks for pointing that out in my sig. However, IIRC, sentence fragments don't represent grammatical error in informal speech.
Edited: My last edition came out too late.
Thank you. That will do more than enough.
Proud member of the Online Campaign for Real English. If you believe in capital letters, correct spelling and good sentence structure then copy this into your signature.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Would it be clearer if it was a parameter to setProjectionMatrix()? It seems to make sense to set them both together, since that's the only circumstance under which IsOrthogonal should change.
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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way