Modifying the fps camera.

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.
Post Reply
Elazul
Posts: 38
Joined: Fri Mar 23, 2007 4:47 pm

Modifying the fps camera.

Post by Elazul »

This may sound odd, but i need to make some major modifications to the fps camera mode, and i need some help.

what i'm trying to do is the following using the fps camera:

1- leave movement forward backwards, left and right as they are.

2- use another set of keyboard buttons to change the p.o.v (which is what the mouse normally does.)

3- make the mouse cursor visible, and replaced with a mesh/bitmap that can move around the screen.(alternatively, i'm planning further on, to make the p.o.v change with one mouse, and the cursor move around with another by splitting the mice.)



any suggestions (perferablly with code examples)

imagine a fps type game, that has something in common with myst , where you move around, but you hafta click on items and such.

any suggestions?

i dunno if this is an advanced type question cause i'm a n00b, if it is, please move it.

thank you in advance.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

clicking in objects i mens raycasting again.. i suggest you not to get involved in such difficulties unless you are experienced enough
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

you can modify the animate part and replace it with keys instead of using the mouse position if i understand it correctly. ( in the dll )

use :: ->getCursorcontrol()->setvisible(true)

and draw a texture using the drawtexture on the cursor coords ->getCursorcontrol()->getPosition()
Elazul
Posts: 38
Joined: Fri Mar 23, 2007 4:47 pm

Post by Elazul »

I'm sorry to be a bother, but i really don't understand what you're asking me to do ...
first up, what does ray tracing have to do with clicking on objects on screen? shouldn't a normal on screen position suffice?

secondly, how can i modify the animate part? that's what i don't understand.

and what's the exact command to draw a texture on the cursor?

thanks again in advance.
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

raycasting gives you ability to cast a ray from cam and pick one (or maybe more) objects in ray's way. clicking on the object could be made like this - you cast a ray, get first object in its way, check a range between you and object and if its near you do something. actualy i havent done anything like this, i just know theory a bit :)
cowsarenotevil
Posts: 19
Joined: Fri Nov 18, 2005 4:14 pm

Post by cowsarenotevil »

Hey, that's exactly what I'm doing for my current game. All I did was keep the cursor on hidden and draw a 2D sprite in the center of the screen (the "real" cursor is still invisible). For the FPS camera the cursor really just stays in the middle, and I didn't see the need to change that. It's better to use a 2d sprite than a real cursor for two reasons: real cursors have some color restrictions, etc. and they're a pain to make, and with the FPS camera the cursor twitches around a bit because it has to be allowed to move a bit before being reset so that the engine can measure how much it was moved (at least that's how Irrlicht seems to do it).

Clicking on objects (this is called picking, by the way) is also really easy; just follow the event handler and collision tutorials and if you actually pay attention to what they're doing, you won't have a problem. You won't need to deal with manual raytracing or projection, etc. if you just let irrlicht do it for you.
Post Reply