how to place a camera in the centre of a map

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
JWein

how to place a camera in the centre of a map

Post by JWein »

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!!!!!!! :D 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:D)
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Did you add a camera :P ?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

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!
Image
JWein

camera

Post by JWein »

we but i use gamespace i made this model using gamespace how can i know the cordinates ?
FleshCrawler
Posts: 108
Joined: Fri Aug 22, 2003 1:04 pm
Location: Kerkrade, Netherlands
Contact:

Post by FleshCrawler »

i mostly use ->setPosition(0,0,0);
if i want something exactly in the center.

or better said, i used to, but i'm about to pickup again :P
I've been absent for really long, but i'm ready to reign my terror on you once again, mwuahahahahaha
JWein

it's stupid but....

Post by JWein »

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 :D isn't there a function to do this automatically ?
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

we but i use gamespace i made this model using gamespace how can i know the cordinates ?
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:

Image

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:
Image

not centered pivot:
Image

your insertion point might be not centered as in the second case

cheers
Image
Kande
Posts: 19
Joined: Fri Sep 10, 2004 9:37 pm
Location: Mannheim / Germany
Contact:

Post by Kande »

The origin (0,0,0) in gamespace (truespace) is where the green and the blue line of the grid cross each other.
Life is expensive..... but a trip around the sun is included.
JWein

now maybe i understand

Post by JWein »

Okay, now I understand thank you!!!!!!!!!!!! :D
JWein

Post by JWein »

yet problems.... I've problems ...See this screenshot of my model in gamespace (truespace).. please help me!! :-/

Image[/img][/code]
Guest

Post by Guest »

yet problems.... I've problems ...See this screenshot of my model in gamespace (truespace).. please help me!! :-/

Image
Kande
Posts: 19
Joined: Fri Sep 10, 2004 9:37 pm
Location: Mannheim / Germany
Contact:

Post by Kande »

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.
Life is expensive..... but a trip around the sun is included.
JWein

uhmmm

Post by JWein »

my camera must be in 0,0,-1 because i wrote this game in a particular way.
So i can't move the camera, i can only rotate the object or move it.
andy0482
Posts: 23
Joined: Mon Sep 13, 2004 6:22 pm

Try scaling the image up

Post by andy0482 »

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
Kande
Posts: 19
Joined: Fri Sep 10, 2004 9:37 pm
Location: Mannheim / Germany
Contact:

Post by Kande »

@JWein

Did you check if you have lighting switched of?

Or you switch lighting on and add a light to scene.
Life is expensive..... but a trip around the sun is included.
Post Reply