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 do I limit the Camera and character rotation

Author
Message
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 8th Jul 2009 08:23
OK I just need to know how can I limit my characters and camera rotation, so when I trun a 180 full trun, I don't see the characters back.

here is my code:

PostionCameraToObject:



and this is how i rotate my character:

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 8th Jul 2009 18:50
something like this:

BASIC style pseudocode today

yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 8th Jul 2009 21:32
ok I did this:



But it just gives me this error :

error C2106: '=' : left operand must be l-value, isn't dbCameraAngleY() a value?
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 8th Jul 2009 22:00
yeah, you cant just say CameraAngleX = in GDK, you have to use the function, dbXRotateCamera I think. E.g. dbXRotateCamera(RotateX+90)

Iuzidal
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location:
Posted: 8th Jul 2009 22:06
An "l-value" is something you can assign to. It means something that belongs on the left side of an '=' (assignment operator). In this case, you cannot assign to the return value of that function.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 8th Jul 2009 22:46
ok I did as you said, changed the CameraAngleX() to CameraAngleX and dbXRotateCamera(RotateX+90) intstead of RotateX+90.



it now gives me this:

"error C2563: mismatch in formal parameter list"
"error C2659: '=' : function as left operand"


:/
Iuzidal
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location:
Posted: 9th Jul 2009 01:23 Edited at: 9th Jul 2009 02:16
I believe he was saying that the rotate will assign the angles for you... just call them:



Edit: Originally I just removed the syntax error, but I think the logic was wrong as well. At work and unable to test.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 9th Jul 2009 20:56 Edited at: 9th Jul 2009 21:00
you cant simply change a function to a variable by removing the ().

instead, make a new variable and call it CameraAngleX for example.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 9th Jul 2009 23:44
removing the brackets from a function enables it to be used with pointers etc, but that's top secret C++ guru stuff so shhhhh.

yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 10th Jul 2009 13:47
lol thx, I couldn't use that in tije, alreayd handed in the game, but thanks for you help, thanks a lot

Login to post a reply

Server time is: 2024-10-01 06:01:41
Your offset time is: 2024-10-01 06:01:41