need helpwith several things:

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.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

need helpwith several things:

Post by afecelis »

1. I got my level working with collision and loading ok, but my camera is showing up facing a wall instead of a corridor I want. How can I rotate it 90 degrees clockwise? (I know it's a simple question, but I'm just learning to program). In other words, what are the commands to rotate the camera?

2. wasd navigation.

3. adding esc support to exit.

4. Adding a skybox

please don't tell me tofollow the techdemo sample. So far I've used as much as I can from it and this is where I'm at right now.

thnx...in advance! :wink:
Image
LordNaikon
Posts: 164
Joined: Wed May 05, 2004 5:34 pm
Location: Germany Berlin
Contact:

Post by LordNaikon »

is it that hard to use the search funktion?

camera:

Code: Select all

scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 4000.0f, -1, 0, 0);
	camera->setFarValue (  90000.0f  ) ;
	camera->setFOV(1.4f);
	camera->setPosition( core::vector3df(8000,1000,8000)); 
	camera->setTarget( core::vector3df(0,10,-40 ));
you can delete fov and far value .. play around with them to learn what they caused like every other people who work with irrlich (try it out)
position is the camera position target the piont you look at

skybox:

Code: Select all

scene::ISceneNode* skyboxNode = smgr->addSkyBoxSceneNode(
		driver->getTexture("irrlicht2_up.bmp"),
		driver->getTexture("irrlicht2_dn.bmp"),
		driver->getTexture("irrlicht2_lf.bmp"),
		driver->getTexture("irrlicht2_rt.bmp"),
		driver->getTexture("irrlicht2_ft.bmp"),
		driver->getTexture("irrlicht2_bk.bmp"));
you should also try to look at the documentation!!

for the other things you should use the search funktion! it's not that hard
q|^.^|p beeing every time friendly to everyone
sys: 2500+Barton 512MB 6600GT WinXP
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thanks for replying!

I'll try the search thingie. I'm just learning, so all this experience is very edifying.


thnx!!!
Image
LordNaikon
Posts: 164
Joined: Wed May 05, 2004 5:34 pm
Location: Germany Berlin
Contact:

Post by LordNaikon »

i know it's hard ! you should now try to create the the same code with using the docu!! and understand how the docu works! do the same with the tutorials. if you fully understand the tutorials and know how to use the docu you are able to do alot thing with irrlicht!
q|^.^|p beeing every time friendly to everyone
sys: 2500+Barton 512MB 6600GT WinXP
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

many thnx for the help, here's a shot of the results:

http://www.theshower.nl/cgi-bin/genesis ... rmap01.jpg

it was most illustrating!!! thanks

now I gotta learn the other things!!!

ps. Final question:
to make the skybox work, do we need to texture some faces as "sky" texture, or we leave a face open to the constructor and the engine fits the 6 faces?

cheers!
Last edited by afecelis on Tue Jun 01, 2004 11:44 pm, edited 1 time in total.
Image
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

Judging from your first post, it sounds like you haven't been through the examples yet. Well you said you went through the techDemo but it's very complex.

The examples actually step you through each process, just read the commenting in the code. There are tutorials on the website that are the same examples but layed out in tutorial mode.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thnx Domarius,

yep,I guess I'll have to start with the typical "hello world" instead of jumping directly into creating 3d stuff.

the tuts are very good. Perhaps I have to read the API documentation better to check what each thing does.

cheers!
Image
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post by dingo »

To have the W A S D keys used fro movement add the following code (taken from techdemo)

SKeyMap keyMap[8];

keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;

keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;

keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;

keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;

and then in the lin setting up your camera make sure keyMap is included,

ie,

scene::ICameraSceneNode* camera = irrSceneMgr->addCameraSceneNodeFPS(0,100.0f, 300.0f,-1, keyMap,8);
-= Want your C code to control real life robots? www.users.on.net/~symes =-
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Thnx for the help Dingo! gonna try it right away.

LordNaikon, thnx thnx thnx. I found out how to get skybox to work!!!!

newshot:

http://www.theshower.nl/cgi-bin/genesis ... rmap02.jpg

now I'm gonna try a bigger and badder level!!! And try out the wasd navigation.

Next I'll dig for the esc key to exit and gui design

many thanks guys
Last edited by afecelis on Tue Jun 01, 2004 11:45 pm, edited 1 time in total.
Image
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

ok, things are going great. Just added some more stuff to my demolevel.

Dingo, I'm getting the following error:
error C2065: 'keyMap' : undeclared identifier

undeclared stuff is 99% of my errors. I don't know how to declare things.
How can I declare the keymap thing? (I added it to my camera as you told me)

shot:

http://www.theshower.nl/cgi-bin/genesis ... rmap03.jpg
Last edited by afecelis on Wed Jun 02, 2004 12:36 am, edited 1 time in total.
Image
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

EKA_MOVE_FORWARD was one of the things undefined, right?

The compiler doesn't know where to look to find the meaning of this because you haven't used all the namespaces, I recon you have only used:

Code: Select all

using namespace irr;
I recommend using:

Code: Select all

using namespace irr;
using namespace gui;
using namespace scene;
using namespace io;
using namespace core;
using namespace video;
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

yep, I was only using namespace irr;

Thnx for the tip of adding the other ones, I'll make it a standard, but I'm still getting this error:

error C2065: 'keyMap' : undeclared identifier

I suppose I must declare "keymap" as a variable somewhere, but I dunno how.

many thnx Tyn, if anyone knows how to declare it, let me know.

another shot!!!

http://www.theshower.nl/cgi-bin/genesis ... rmap04.jpg
Last edited by afecelis on Wed Jun 02, 2004 12:36 am, edited 1 time in total.
Image
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

If this is in your code ( put it above the main() function ) then it should be defined globally ( meaning you can use it anywhere, the program will know what it means ).

Code: Select all

SKeyMap keyMap[8]; 
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

that did it Tyn!!!!

man, programming is funny. I already had it defined but placed somewhere else. Which criteria should you use to put stuff in your program. I mean, is there a specific order?

wasd navigation is working fine but default arrow movement gets resetted, right?

Any ideas on how to add esc to quit, I already found it in the techdemo but it's more complicated than assigning the wasd keys.

man! I'm getting excited with this stuff. i gotta find info on adding models, weapons, etc etc etc!!!

thnx. I made more progress in these 2 days than in 6 months I've gotten Irrlicht stored in my drive.

cheers!
Image
LordNaikon
Posts: 164
Joined: Wed May 05, 2004 5:34 pm
Location: Germany Berlin
Contact:

Post by LordNaikon »

ohh nice to see what you have done!

it is a great feeling to fix some bugs of your own, isn't it :D

by the way : do you make the skybox textures by your own? the red one seems to be.. where can i get a programm to creat that.. i also need textures many textures.. sound and all the other stuff. i have found many sites but only with few of them
q|^.^|p beeing every time friendly to everyone
sys: 2500+Barton 512MB 6600GT WinXP
Post Reply