how to place a camera in the centre of a map
how to place a camera in the centre of a map
Hi, i've a big problem... If I export a map from gamespace to the .x format and then i load it in irrlicht i can't know where to place the camera and so i don't see anything... Please help meee!!!!!!! I wont that the camera places automatically in the centre of the map or something of similar! (Sorry for my bad English but I'm Italian and I'm 15 years old thanks !! :D)
Irrlicht's coordinate system is concident with almost every 3d app's coordinate system I've tried. So if you model your level around the 0,0,0 coordinates of your world (in your 3d app), when loading it into Irrlicht it should be located in the same place.
Units are also important so set up units according with a gaming unit system.
Apps I have tried that coincide in coordinate system with Irrlicht:
3dsmax
Deled
GtkRadiant
Gmax
Milkshape3d-although it has the bad habit of exporting models in weird directions
AC3d
Then if you add your camera at 0,0,0 it must be in your origin in Irrlicht as well. Just play around with the X,Y,Z values. Remember Irrlicht is an XZ 2d oriented world, while apps like 3dsmax are XY oriented and the vertical axis is Z; in Irr the vertical axis is Y.
hope it helps!
Units are also important so set up units according with a gaming unit system.
Apps I have tried that coincide in coordinate system with Irrlicht:
3dsmax
Deled
GtkRadiant
Gmax
Milkshape3d-although it has the bad habit of exporting models in weird directions
AC3d
Then if you add your camera at 0,0,0 it must be in your origin in Irrlicht as well. Just play around with the X,Y,Z values. Remember Irrlicht is an XZ 2d oriented world, while apps like 3dsmax are XY oriented and the vertical axis is Z; in Irr the vertical axis is Y.
hope it helps!
-
- Posts: 108
- Joined: Fri Aug 22, 2003 1:04 pm
- Location: Kerkrade, Netherlands
- Contact:
it's stupid but....
It's stupid but i can't see the model.USING ->setPosition i've moved the object (it's a house) at -5,-5,0 and the camera to 0,0,-1 but i can't see it help meee isn't there a function to do this automatically ?
Gamespace's grid (same as truespace's) is your coordinate system. Gamespace must display the position of your mouse somewhere. Where you see the 2 darker lines cross in top view thats the center of your "universe" (0,0,0). Check this screenshot in Gmax:we but i use gamespace i made this model using gamespace how can i know the cordinates ?
check in the lower part in the x,y,z; it's displaying where I had my mose at that moment (close to the origin).
Another thing, It might not work moving your model to 0,0,0 with setposition cause its Pivot may not be centerd with the model. So another important thing for your model to show up properly is to have it's pivot centered:
check these 2 screenies:
centered pivot:
not centered pivot:
your insertion point might be not centered as in the second case
cheers
I saw that you move your camera to (0,0,-1)
this means, that the y Coordinate is still 0.
I can see that your level is really in the origin (0,0,0) what means, that the floor of the object is (0,0,0). It looks like, that your camera is in the floor of the object.
Try to place your camera at (0,10,0) and set its target at (0,0,0) so the camera is over the object and looks down to it.
But i have another thought. I guess you have switched lighting on and you dont have a light in your scene of the irrlicht engine. This means, that you dont see everything black, you just see a place, were not only one ray of light touches your object. Set the AnimatedMeshSceneNodes
setMaterialFlag(video::EMF_LIGHTING,true);
to
setMaterialFlag(video::EMF_LIGHTING,false);.
This is the flag of how the irrlicht engine should render this object.
this means, that the y Coordinate is still 0.
I can see that your level is really in the origin (0,0,0) what means, that the floor of the object is (0,0,0). It looks like, that your camera is in the floor of the object.
Try to place your camera at (0,10,0) and set its target at (0,0,0) so the camera is over the object and looks down to it.
But i have another thought. I guess you have switched lighting on and you dont have a light in your scene of the irrlicht engine. This means, that you dont see everything black, you just see a place, were not only one ray of light touches your object. Set the AnimatedMeshSceneNodes
setMaterialFlag(video::EMF_LIGHTING,true);
to
setMaterialFlag(video::EMF_LIGHTING,false);.
This is the flag of how the irrlicht engine should render this object.
Life is expensive..... but a trip around the sun is included.
Try scaling the image up
I had a problem with gamespace but it was due to the fact that the model was very very small. Try when loading the mesh to scale it up. Stary with units of 10. Then 20, 30, 40, 100, 200. You will see it on one of those.
Later Yo
Later Yo