The origin of world coordinate

Problems building or running the engine, queries about how to use features etc.
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

The origin of world coordinate

Post by limbo »

Hi there,

There's a little problem that has bothered me a lot. After a BSP map has been loaded, how can I know where is the origin and what is the exact position of the map? Many tutorials just tell us to add light by using pLight->setPosition( 60, 80, 100 ); I just wonder how do they decide on the figures.

I know I can just load a simple modle and change its position for some times to get a rough idea the direction of x,y, z coordinates and the origin of the world. But I want to know the accurate position of the origin. Is that possible?

I've used WildTangent before. In WT, you can set position of everything according to the origin. Does Ogre has similar functions? Thanks!

I know I may have asked silly question. Please forgive me if I did :oops:
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67

Post by sinbad »

The origin of the BSP level is (0,0,0) since everything is in world coordinates. Where the rooms of the level are is completely dependent on how the level creator decided to do it, (0,0,0) might not be 'inside' a valid area of the level at all. If you mean 'places where the player can walk', that's an entirely different question.

Tutorials just decide where to put lights etc. You can get the position of any object in the world in Ogre too if you want, use SceneNode::_getDerivedPosition.
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

Post by limbo »

Thank you sinbad! I load a rectangle room by using mSceneMgr->setWorldGeometry("test2.bsp"); Can I know where the origin (0,0,0) is in the room. I mean is the origin at one corner or the center of the room?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8

Post by haffax »

The origin of your room is the same as in your editor. It is not changed in Ogre. It is the position of the root node. So if you don't really know the room's origin attach some mesh to the root node and you'll see it. Important to note is, that Ogre uses a different coordinate system compared to Hammer or Radiant. In Ogre +Y points up and +Z point towards the viewer.
team-pantheon programmer
creators of Rastullahs Lockenpracht
limbo
Kobold
Posts: 27
Joined: Fri Dec 10, 2004 7:08 am

Post by limbo »

I fully understand now. Thanks!!!