Jump to content
  • Advertisement
Sign in to follow this  
thedoofus

Texture Mapping

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

Hey - I'm hoping this is a really basic question - but I'm trying to implement texture mapping into my ray tracer. I know how to get my UV co-ords and all that jazz, but I haven't a clue how to read the rgb values into my program. It really is that basic. I'm hoping theres a simple fscanf kind of function around but can anyone give me any answers or directions into where to look? I'm using C programming. Cheers, HH

Share this post


Link to post
Share on other sites
Advertisement
If I understand your question right, it depends on the format the texture is in.
I believe there's a document on loading BMP files somewhere on this site that can help. Another altnerative is to use some library like FreeImage, which will do the image loading for you and provide you with a memory buffer containing the pixel data.

Edit: Though I'm not sure if FreeImage is C or C++. Haven't really used it.

Cheers,
--Brian

Share this post


Link to post
Share on other sites
There are alot of different libaries or example code for specific image formats:

PNG - http://www.libpng.org/pub/png/libpng.html
TIFF - http://www.libtiff.org/
BMP - http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/

ImageMagick supports several formats:
http://www.imagemagick.org/script/index.php

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!