Rael Delcon
Registered User
Join date: 23 Nov 2006
Posts: 86
|
12-06-2008 23:57
I've created a small program that generates sculpties starting from a "description" of the object to be created.
I can export it as a sculpt map for SL or as a .obj to be imported in a real modeler (say wings3D).
The geometry part of the .obj (vertices and faces) has been relatively easy but I'm having hard times with the UV map.
I understood UV coordinates ranges from 0.0 to 1.0 so I "sampled" a grid of 32x33 points at regular intervals and mapped (in the same order) each face to an UV triangle.
I must have missed something as the resulting UV map (as I see it when loaded in Wings3D) is not correct.
Does anyone have a description of how a .obj UV maps should be structured to work properly according SL rules?
Many thanks!
RD
|
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
|
12-07-2008 10:54
You're right that the coordinates range from 0.0 to 10.. But UV coordinates are specified at each vertex. For a 32x32 bitmap you're always going to need 32x32 coordinate pairs. I'm not sure what you meant when you referred to sampling a grid of size 32x33.
As for what the coordinates should be, if the dimension doesn't wrap, you want 32 values equally spaced between 0 and 1, inclusive. So the values would be 0, 1/32, 2/31, ..., 31/31. But if the dimension wraps (producing 32 faces instead of 31), you want the values 0, 1/32, 2/32, ..., 31/32, so that the strip ftom 31/32 to 32/32 will be used for the face created by the wrap.
Does that make sense?
|
Rael Delcon
Registered User
Join date: 23 Nov 2006
Posts: 86
|
12-08-2008 00:33
Thanks Omei! To see if I get it right, i've create a blog post with a summary of what I've understand about the UV mapping on sculpties. I would really appreciate any comment or feedback (especially if I'm wrong  ) http://a3dsculpt.blogspot.com/2008/12/uv-mapping-for-sculpties.html
|
Rael Delcon
Registered User
Join date: 23 Nov 2006
Posts: 86
|
12-08-2008 10:57
Ok. I rewrote the export function in C and got it right now! Thanks everybody!
|
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
|
12-13-2008 01:51
looks like the UV map has an error
|
Rael Delcon
Registered User
Join date: 23 Nov 2006
Posts: 86
|
12-13-2008 05:54
Ach! Can you be more specific? I'll go checking again ....
|