Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualvoodoodrul

Posted 12 November 2013 - 08:55 PM

Thanks wintertime! You're suggesting an idea similar to the "localized world" I was thinking of. That did indeed fix the gaps. However, now I have the same problem with my camera - it lacks float precision and jitters around when far from the origin, simply because the floats don't have the decimal precision. 

 

My outer render loop does:

 

1) glLoadIdentity();

2) Look through the camera - rotate pitch/yaw, then translate to some obscenely large x,y,z

    For some reason, I have to negate all the values when I do this.  glTranslatef(-vectorPos.x, -vectorPos.y, -vectorPos.z);

3) Render the world

    First translate to camera position

4) For each chunk, translate only the difference between the camera position relative to the chunks position. 

 

I wonder if I'm doing this all wrong. Should I keep the entire world near the origin ( camera essentially fixed at (0,y,0) ) and just move the world around relative to the origin?

 

Eh.. That probably won't help. The fundamental problem is that there isn't enough decimal precision for acceleration on vectors to be smooth. I guess I need to convert to doubles instead of floats, or accept the fact that things jitter around when I go to 500000,0,500000 and beyond. 


#1voodoodrul

Posted 12 November 2013 - 08:40 PM

Thanks wintertime! You're suggesting an idea similar to the "localized world" I was thinking of. That did indeed fix the gaps. However, now I have the same problem with my camera - it lacks float precision and jitters around when far from the origin, simply because the floats don't have the decimal precision. 

 

My outer render loop does:

 

1) glLoadIdentity();

2) Look through the camera - rotate pitch/yaw, then translate to some obscenely large x,y,z

    For some reason, I have to negate all the values when I do this.  glTranslatef(-vectorPos.x, -vectorPos.y, -vectorPos.z);

3) Render the world

    First translate to camera position

4) For each chunk, translate only the difference between the camera position relative to the chunks position. 

 

I wonder if I'm doing this all wrong. Should I keep the entire world near the origin ( camera essentially fixed at (0,y,0) ) and just move the world around relative to the origin?


PARTNERS