looking for wiki code example header (ogremaths.hpp)

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
justwantadevenv
Gnoblar
Posts: 8
Joined: Sun Oct 04, 2015 6:58 pm

looking for wiki code example header (ogremaths.hpp)

Post by justwantadevenv »

Note to moderators: I'm not sure if this is the right sub-`forum location, or if it should go in "help" or "papercut" (which mentions quick documentation questions but I can't post there). Please move if necessary

I am trying to rotate a 3d model in a similar way to the following:
1. Reset world. (Identity matrix)
2. Rotate object, translate them to the right location, scale etc
3. Rotate world as needed.

I'd like to use something similar to processing's (https://processing.org/) rotate functions, which allow for rotating on a specific axis.https://processing.org/reference/rotateY_.htmlfor example


From what I read ogre doesn't have any rotate functions that work with X,Y,Z, but there is this: http://ogre3d.org/tikiwiki/Euler+Angle+Class
However, I can't find ogremaths.hpp which is required. It is not part of the ogre ubuntu package.

Code: Select all

#include "OgreMaths.hpp"
#include "OgreVector3.hpp"
#include "OgreQuaternion.hpp"
#include "OgreMatrix3.hpp"
Any ideas?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5539
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1399

Re: looking for wiki code example header (ogremaths.hpp)

Post by dark_sylinc »

Not sure why the wiki put them with the extension ".hpp" because these have always been with ".h" extension.
Change the hpp to h and it should compile.
justwantadevenv
Gnoblar
Posts: 8
Joined: Sun Oct 04, 2015 6:58 pm

Re: looking for wiki code example header (ogremaths.hpp)

Post by justwantadevenv »

dark_sylinc wrote:Not sure why the wiki put them with the extension ".hpp" because these have always been with ".h" extension.
Change the hpp to h and it should compile.
thank you. I got it working now.

Just curious, what is the reason why this isn't included by default in ogre?


-------------

To make it work
ok, I made the following modifications to the lowlevelogre example and not this works.
in Euler.h:

Code: Select all

#include "OgreMath.h"
#include "OgreVector3.h"
#include "OgreQuaternion.h"
#include "OgreMatrix3.h"
in lowlevelogre.cpp
after including it

Code: Select all

using namespace Ogre;
before the loop

Code: Select all

Euler euler;
double rollout = 1.0f;
in the main loop

Code: Select all

euler.yaw(Degree(rollout)).pitch(Degree(rollout)).setRoll(Degree(rollout));
headNode->setOrientation(euler);
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: looking for wiki code example header (ogremaths.hpp)

Post by Kojack »

Checking the history, the headers were changed two revisions ago last year. I guess klaim had a customised ogre.
I'll fix it soon (on a phone right now).