Jump to content
  • Advertisement
Sign in to follow this  
Phoresis

Assigning texture co-ords on the fly

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

I'm wondering how I can assign texture co-ordinates to a many-sided 2d polygon, if the polygon is being built in a loop by reading data from a file i.e the program doesn't know what type of polygon is being read in.

Share this post


Link to post
Share on other sites
Advertisement
? Ok you have a model in a file. You are reading that polygon from a file right? If you can do that, then why not edit texture coords before loading the file.

How are you assigning them on the fly. There could be alot of ways to do this like: Select all the triangles and map them individually to a bitmap. Or you could project the entire polygon onto a bitmap.

Share this post


Link to post
Share on other sites
File reading functions should only be used for reading files, IMHO. If data is missing, just
assign default values to it, like zero.

Then, do your texture coordinate assignment after all data has been read.

Share this post


Link to post
Share on other sites
btw, you said you're reading in 2D data, so if you don't care about scale, just assign the same 2D vertex positions to the tex coords. Simple.

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!