|See what's going on with flipcode!|
Assigning UVs To Complex Objects
Question submitted by (12 August 1999)
|Return to The Archives|
|I am trying to apply a texture to complicated 3D objects but am unsure how to properly map the texture coordinates. Up until now I have only had a need to map planer objects, much easier. I have seen articles mentioning texture plane projections and such, but I'm not sure how to implement asolution without losing detail on the sides of my object.|
The possibilities here are limitless. It really depends
on the shape of the object. Is it convex or concave? How complex (i.e. a
detailed human figure) or simple (just a hand)?
In my experience, textures are mapped via texture mapping tools (i.e. the utilities in 3DS Max or LightWave, etc.) The only time I've seen other techniques used are in specialized "editors." These tend to revolve around creating architectural models, not detail models.
In the case of architectural models, you can get a good starting point with planar mapping. To do this, visit each polygon and determine the major axis of the normal (i.e. find the MAX of the polygon's normal [X, Y, Z].) Then set the other two components to 0. This defines your mapping plane's normal. For instance, a polygon normal of [0.2, 0.2, 0.7] the max is 0.7, keep that and make the others 0 resulting in [0, 0, 0.7]. Normalize and you end up with [0, 0, 1.0]. This is your mapping plane normal.
Response provided by Paul Nettle
This article was originally an entry in flipCode's Fountain of Knowledge, an open Question and Answer column that no longer exists.