Jump to content
  • Advertisement
Sign in to follow this  
RiseAgainst

OpenGL Is it possible / how to...

This topic is 4990 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

Import an jpeg image in an openGL program and split it into 16 different segments and move it about with input from keyboard / mouse? any help on how to do this would be massivly apprechiated!

Share this post


Link to post
Share on other sites
Advertisement
Well it is possible to import a jpeg into an OpenGL program. If you wanted to split up the image, then just make 16 quads, use the jpeg as a texture, and just change the texture coordinates for each quad.

Share this post


Link to post
Share on other sites
1. YOu make quads with GL_QUADS, if you dont know that, time to go back to the starting point.

2. Tex coords are easy to split up, to get the first 1/16th you just do
float s = 1.0f/16.0f;
glTexCoords2f(s, s);

Share this post


Link to post
Share on other sites
i actually didnt mean in one cube i meant as 16 individual segments that wrre all displayed 2D at once and could be moved by input...
apologies for not making that clearer

Share this post


Link to post
Share on other sites
It would really be in your best intrest to take your image and manually split it into the pieces, then use those. That way, you can just do simply texturing and be on your way. Sure, you could do it programatically, but it might take a little bit more math and time to get it 'right'. Do you have to split it up in the program?

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.

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!