Jump to content
  • Advertisement
Sign in to follow this  
3dnewbie

freelook fps always rotating around 0,0 (wide orbit)

This topic is 4089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I use this to fake a pseudo freelook like in fps, but it always rotates around coordinate 0,0. So when i go left a bit, the orbit increases because it stills rotates around 0,0, even though 0,0 is not in the centre anymore. It would like it to always rotate around the center of the screen. I hope you know what i mean. How would i go about doing this ?
	/* Rotations for FREELOOK */
	if(FREELOOK) {
	if(init) {
	user_x=user_x_prev; 
	user_y=user_y_prev;
	init=0;}

	glRotatef(user_x,1.0f,0.0f,0.0f);
	glRotatef(-user_y,0.0f,0.0f,1.0f);
	user_x_prev=user_x;
	user_y_prev=user_y;}
	else {
	init=1;}

Share this post


Link to post
Share on other sites
Advertisement
rotations happen around the current origin, u can use glTranslate to move this

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!