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 / Camera Positioning

Author
Message
UndeadDragon
15
Years of Service
User Offline
Joined: 15th Aug 2009
Location:
Posted: 17th Aug 2009 14:36
Hi,

Firstly I have made the movement system for my first game, which works fine, but I am having problems with the camera. It works fine when I am moving backwards or forwards, but when I rotate my character, the camera rotates in it's original position. I want the camera to rotate around the object, so that it is still directly behind it. What would be the easiest way to achieve this?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Aug 2009 17:08
Presuming your the object number of your character is 1, I think the following should work:

UndeadDragon
15
Years of Service
User Offline
Joined: 15th Aug 2009
Location:
Posted: 17th Aug 2009 17:40
Thanks for the response.

I just tried that, but it didn't seem to affect the camera. An example of the movement is:



Have I maybe put the camera functions in the wrong place?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Aug 2009 18:44
Try commenting out all your other camera commands, then just call the code I give you once before the end of your loop. Also, try putting your camera number at the start of the command

dbSetCameraToFollow(cameraNumber, dbObjectPositionX(1) etc....) gives you a third person camera view which will follow any object.

If you get it to work but its acting strange, try using dbRotateObject() instead of dbTurnObjectLeft() etc...
UndeadDragon
15
Years of Service
User Offline
Joined: 15th Aug 2009
Location:
Posted: 17th Aug 2009 19:53
I didn't realise that the other camera functions were there

Unfortunately, that did not solve the problem. I tried the functions in the if...else section and at the end of the loop, but they did not seem to control the camera. I then tried the function where I specify the camera's id. That seems to control the camera (possibly) but it takes it far away, so all I can see is a green screen. Any more ideas?
UndeadDragon
15
Years of Service
User Offline
Joined: 15th Aug 2009
Location:
Posted: 17th Aug 2009 23:17
I managed to fix it.

I just rewrote my movement functions.

Login to post a reply

Server time is: 2024-10-06 07:27:50
Your offset time is: 2024-10-06 07:27:50