Jump to content
  • Advertisement
Sign in to follow this  
immuner

OpenGL 3d texture rotation

This topic is 3734 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 am trying to efficiently navigate through my 3d volume. The way i've thought so far is rendering to a sprite the first slice of the volume (the current one i'm using is 256 x 256 x 200) and according to the rotation of the camera rotate my uvw's since the sprite remains static. I am also using shaders for that. So far, so good but i've bumped onto problems. Rotation along z axis is fine, but rotation along x and y is not. For example, if i rotate 45 degrees along x then instead of getting a result of an object being rotated properly, it shows up like it goes down the screen and the more down it goes the more stretched it shows and comes back from the top stretched and re-gets its original non-stretched form when it goes back to the center of the screen. The formula i'm using is: 1) translate the texture coordinates by 0.5,0.5,0.5 so they are moved in the origin (i am using opengl, so bottom left hand corner of the screen). 2) do my rotations 3) translate back by -0.5,-0.5,-0.5. I assume there is an issue with the translation on the z axis, but i have played with all the values from 0 to 1 and the result is always more or less the same. Is there something i'm doing wrong?(i am using opengl as my rendering API). Any help would be really appreciated.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!