Jump to content
  • Advertisement
Sign in to follow this  
krippy2k8

Generating good UV coordinates

This topic is 3527 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 all, I'm currently in the process of developing a level editor for a game that I'm developing. I've got a pretty good start, but there is something I would like some input on. I am highly interested in any input or resources on generating good UV coordinates for convex hulls. For starters I'd love to be able to duplicate the "Box" UV mapping that can be done in 3D Studio Max on arbitrary meshes. Or something similar to what applications like 3D World Studio do to produce uniform texturing. I've seen some material that gives some mathematical formulas, but I'm unsure of what some of the inputs represent or how to find them, i.e. UV offsets, texture axis, etc. Any help on this would be great. Thanks

Share this post


Link to post
Share on other sites
Advertisement
http://www2.in.tu-clausthal.de/~hormann/parameterization/index.html

Gives an overview of some parameterization methods, but may be overkill for your needs.

Also look at the publications at:
http://www.cs.ubc.ca/~sheffa/
http://graphics.cs.uiuc.edu/~garland/

Share this post


Link to post
Share on other sites
Thanks for the links. Those are interesting and something I will definitely be reading up on down the road, though as you mention they're probably a bit overkill for my current needs.

I decided to dig through my boxes of old books, and finally found a description of what I needed that helped make sense of things in 3D Games: Real-time Rendering and Software Technology. The general technique is known as two-part texture mapping, and basically it involves mapping the UVs to a simple intermediate object like a plane, box, sphere or cylinder first, and then map it to your object by following your objects vertex normals to the intermediate object and calculating the UV from the intersection point.

Then there's a fairly nice simplification that you can do for Box mapping which I found by looking at the Half-Life SDK source, where you first determine which side of the box you'd be hitting and then performing a simple calculation based upon the dot product of the object vertex and the axes of the texture on that side of the box, and the width and height of the texture map.

It's not perfect but it's good enough for my current needs.


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!