Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

free moving

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 IStrikerI   Members   

122
Like
Likes
Like

Posted 15 July 2001 - 06:46 AM

i have a problem with free moving in my 3d-world: i can move to the directions forward, backward, strafing left and right and i can look to any direction with my mouse. and now i want it, that i can move to any direction i am looking like the spectator mode in the quake engines. here is a part my code. can anyone help me to change the code that i can move to any direction i am looking? or has anybody a better way of moving in a 3d-world - please tell me !! ... i think i have to say that the core of this code is from the nehe tutorials void Update() { static float xrot=0,yrot=0; static float xpos=0,ypos=0,zpos=0; if(win.key[VK_UP]) { xpos-=(float)sin(-yrot*pi180)*0.05f; zpos-=(float)cos(-yrot*pi180)*0.05f; } if(win.key[VK_DOWN]) { xpos+=(float)sin(-yrot*pi180)*0.05f; zpos+=(float)cos(-yrot*pi180)*0.05f; } if(win.key[VK_LEFT]) { xpos-=(float)cos(yrot*pi180)*0.05f; zpos-=(float)sin(yrot*pi180)*0.05f; } if(win.key[VK_RIGHT]) { xpos+=(float)cos(yrot*pi180)*0.05f; zpos+=(float)sin(yrot*pi180)*0.05f; } mouse.GetState(); yrot+=(float)mouse.mstate.lX; xrot+=(float)mouse.mstate.lY; glRotatef(xrot,1.0f,0.0f,0.0f); glRotatef(yrot,0.0f,1.0f,0.0f); glTranslatef(-xpos,-ypos,-zpos); }

#2 IStrikerI   Members   

122
Like
Likes
Like

Posted 16 July 2001 - 09:39 AM

shit !!
now i got it!!
i think it was too easy

#3 Kickpuncher   Members   

564
Like
Likes
Like

Posted 16 July 2001 - 09:42 AM

what''d you do?



Email
Website

"If you try and don''t succeed, destroy all evidence that you tried."




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.