Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How can I add a new camera in a GDK project ?

Author
Message
Andrew Vlad
15
Years of Service
User Offline
Joined: 14th Jul 2009
Location:
Posted: 14th Jul 2009 22:50
I have tried to find a way in which I can add a new camera in my projects so I can freely move around with the arrow keys whilst being able to look around using the mouse without interfering with my movement pattern.

If there is any other way I am open to any suggestions

thank you for your help
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 15th Jul 2009 05:20
Moved to the GDK boards. Pleas post any code related queries here.

Cheers

Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 15th Jul 2009 07:33
Well, you can have mouse movement look control at the same time as actual movement without using more than one camera.

The idea of adding another camera would be primarily to have a different render target, so you can send an image from the camera to a texture or create a "surveilance camera" kind of thing.

Here is a code snippet of some simple camera look code, along with something that will allow you to move at the same time with W S A D keys.




You call it like this :



from inside you main loop, it needs to be called every game loop to work.

Lastly, if you do want to make another camera the code to do that is :



If it ain't broke.... DONT FIX IT !!!
Imran
15
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Chicago,IL
Posted: 19th Jul 2009 16:51
i guess you can create a new camera using dbMakeCamera(int cameraID)

Login to post a reply

Server time is: 2024-10-01 08:20:05
Your offset time is: 2024-10-01 08:20:05