|
|
Hi. I'm trying to write an OBJ to POv converter. I'm currently using
VBA (as found in MS Office programs as well as a slew of others
nowadays) although I'll probably switch to Visual Basic 5 (which I
have lying around and so can install) in the nearish future. It's not
fast, but it IS flexible and easy to use.
OK, right, now then. It's going remarkably well so far. It can convert
an OBJ file exported from Poser4 with normals and - apparently - uv
Mapping data. However, I'm struggling with the uv mapping syntax of
mesh2 OR I'm doing something silly. By default the texture map of the
model I was aiming for doesn't line up at all well. Switching to a
simpler model (a set of stairs) I managed to get the texture to line
up the same (AFAICS) in both Poser and POV by tweaking the image map
statement to translate and scale the texture map thus:
texture_list
{
1,
texture { pigment { image_map { tga "OBJuvPOV.tga" } }
translate <0.5,0.0,0.0> scale 0.75}
}
Apologies for the formatting - by default the "texture { pigment ...
0.75}" is all one line and I'm no good at formatting anyway.
However - changing back to the original model and re-testing with the
same parameters - doesn't work. Should the texture be scaled relative
to some aspect(s) of the model's size?
Obviously some of the details are hand-coded - the image map name (for
example) isn't read from the .OBJ (or .MTL) file but I'm using "fixed
parameters" for many things until I'm SURE I've got them working - and
I'm floundering unexpectedly on uv Mapping. If the texture should be
scaled and moved like this then I'm fine - as long as I know why I'm
doing what I'm doing (and how to calculate the relevant
"modifications).
I'm using what I beleive is the latest (3.1e) variant of SuperPatch
POV. Can anyone tell me if the translation and scaling I've applied is
"as intended", or a result of a buglette in SPPOV, or "well it all
works well here" (in which case its probably something to do with my
interpretation of the .OBJ file format).
Curiously, I've compared a few co-ordinates between the output of my
"OBJuvPOV" and "OBJ2POV". While the latter uses smooth triangles and
mine uses the "mesh2" syntax (or tries to) the co-ordinates appear, at
a quick glance, to be near identical (OBJ2POV actually rounds the
co-ordinates up slightly where OBJuvPOV doesn't - at least, not yet).
Help? Anyone? I'm going mad!
Cheers,
Cliff Bowman
Why not pay my 3D Dr Who site a visit at http://www.who3d.cwc.net/
Post a reply to this message
|
|