POV-Ray : Newsgroups : povray.general : UV mapping? Server Time
29 Nov 2024 21:31:34 EST (-0500)
  UV mapping? (Message 1 to 10 of 10)  
From: triple r
Subject: UV mapping?
Date: 4 May 2005 12:35:00
Message: <web.4278f8dd58f725ed9c7de2fb0@news.povray.org>
I got a little sidetracked and started playing around with Wings3D (on a
mac).  The program works great, but I couldn't get the pov export plugin to
work, so I wrote a program to parse a .obj file and output mesh2.

The problem is when I try to use uv-mapping.  It doesn't work too well in
Wings3D - so I figure either it doesn't work too well or I don't know how
to work it - so I tried the free UV Mapper program.  At best, that just
does spherical mapping that I could do right in POV-Ray anyway.  Wings3D is
really slow for complicated models and gives a lot of overlap and ugliness
when it does work.  I have a suspicion that what I should have done is
UV-map it from the start, then create the model.  But it's too late for
that.  The topology of the model is spherical, but there is some overlap
so, as seen in p.b.i., parts around the eyes and neck get pretty distorted.

My current plan is to get my program to find uv vectors with spherical
mapping then some kind of pseudo-mass-spring model to clear up the rough
spots, but I'm pretty lost on this one.  I've never really done any mesh
modeling before, so I'm not really sure how it should work.  Any help?

 - Ricky


Post a reply to this message

From: Jim Charter
Subject: Re: UV mapping?
Date: 4 May 2005 14:17:19
Message: <427911af$1@news.povray.org>
triple_r wrote:
> I got a little sidetracked and started playing around with Wings3D (on a
> mac).  The program works great, but I couldn't get the pov export plugin to
> work, so I wrote a program to parse a .obj file and output mesh2.
> 
> The problem is when I try to use uv-mapping.  It doesn't work too well in
> Wings3D - so I figure either it doesn't work too well or I don't know how
> to work it - so I tried the free UV Mapper program.  At best, that just
> does spherical mapping that I could do right in POV-Ray anyway.  Wings3D is
> really slow for complicated models and gives a lot of overlap and ugliness
> when it does work.  I have a suspicion that what I should have done is
> UV-map it from the start, then create the model.  But it's too late for
> that.  The topology of the model is spherical, but there is some overlap
> so, as seen in p.b.i., parts around the eyes and neck get pretty distorted.
> 
> My current plan is to get my program to find uv vectors with spherical
> mapping then some kind of pseudo-mass-spring model to clear up the rough
> spots, but I'm pretty lost on this one.  I've never really done any mesh
> modeling before, so I'm not really sure how it should work.  Any help?
> 
>  - Ricky
> 
> 
Most of us use Poseray for the .obj2mesh2 conversion but if your routine 
handles the uv list, then it does.

I am a little reluctant to comment here since I have yet to produce a 
uvmapped result of professional quality but here is the direction I've 
gone in fwiw.

Sometimes I use AutoUV in wings but for most situations I use Uvmapper. 
  I do have the Pro version but any operations I use could be done on 
the free version, just more awkwardly.

The thing I like to do is to export the unsmoothed cage to Uvmapper (via 
.obj format)  I then create the uvcoordinates and the corresponding 
template in Uvmapper.  Uvmapper supports a variety of projections to 
start from (besides spherical). Of course you can then pull the points 
to "unfold" the model and get a better correspondence to the texture 
map. Also, if, before you export from Wings, you apply materials to 
different sections of your model, then in Uvmapper you can use these 
material names to select and map these areas separately using different 
projections.  This is sometimes helpful because it gives you easier 
control over "seam" placement.  When I "save" the model from UVmapper, I 
save with the option: "in a single group".  Now that saved file (which 
is in .obj of course but with uv's ) can be *"imported"* back into Wings 
for smoothing.  The smoothed model can then be exported for conversion 
and/or for loading back into Uvmapper if you wish to make a template 
which reflects the smoothed model. I then do the final conversion to 
mesh2 with Poseray.  (It is also true that Poseray supports smoothing 
and export to .obj so I can picture other workflows than what I have 
just described )


Post a reply to this message

From: Tim Nikias
Subject: Re: UV mapping?
Date: 4 May 2005 15:08:07
Message: <42791d97$1@news.povray.org>
> I got a little sidetracked and started playing around with Wings3D (on a
> mac).  The program works great, but I couldn't get the pov export plugin
to
> work, so I wrote a program to parse a .obj file and output mesh2.

Hey, that's something I could have use for as well! The modeller I'm using,
Silo, doesn't have proper UV-support yet (still under development), but I
can export to obj and map it with UV-Mapper Classic. I know that I can use
Poseray to convert the obj to mesh2, and I know that I could just as well
write a small app for the entire thing myself if I'd get around to install
C++ and work myself into the language a little... BUT studies leave me
little spare time, and since you've already written a small app for it...

Does it just take an obj-file and export the proper mesh2 (say, if there are
uv-coords, it will export those to the mesh2, if there are normals, it will
export those, etc.)? No additional "inbuilt" work like cleaning up vertices
or such? If so, would you mind sendingit to me via email, or upload it here
to the newsgroups (in the proper group of course, I'd guess binaries.misc)?

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: triple r
Subject: Re: UV mapping?
Date: 4 May 2005 15:10:00
Message: <web.42791ddbefd573f09c7de2fb0@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> I am a little reluctant to comment here since I have yet to produce a
> uvmapped result of professional quality but here is the direction I've
> gone in fwiw.

That's alright.  I have yet to produce... much of anything.

> The thing I like to do is to export the unsmoothed cage to Uvmapper (via
.... (no reason to quote the whole thing)

Maybe it's my problem then because I can't figure out how to get UVMapper to
do more than display the points and faces.  I can move faces around, but
then they just sit there, disconnected from the rest of the mesh.  The
weld, etc. commands don't seem to do anything (it's the mac version if that
makes a difference.)  It's probably pretty obvious that the solution is to
uv-map right away when it's not too complex rather than at the end.  I
think that's my whole problem in the first place.  I held off though since
the last thing I did was to break the virtual mirror in Wings3D so I only
had to work on half of the model.  UV mapping before it is actually
mirrored seems pointless.  By that time the model is complex enough that I
couldn't have done it symmetrically without a virtual mirror, but too
complex to feasibly shift vertices around by hand in the small window of UV
Mapper or the painfully slow AutoUV of Wings3D.  Is there a simple solution
to this dillema?  Do regions and materials make it that much easier?  Is
the map discontinuous then?

My other problem with UVMapper is the inefficiency.  The file below shows
the .obj output from UVMapper.  Four vertices (v) and four normals (vn)
went in, four vertices, four normals, and nine uv vectors (vt) came out?!
Notice the duplication.  It doesn't even use the first, fifth, or ninth
uv-vector (the middle indices in the face list).  So in the end, it uses
six of nine vectors where only four are necessary.  This doesn't happen at
all if I do it myself.  This isn't a big problem since the final result is
the same, but for large meshes, that can slow things down a bit.  Not that
I'm in a huge hurry, but I still have things to be doing...  Why would they
do this?

 - Ricky

# file generated by UVMapper
# NumVerts/NumTVerts/NumVNormals/NumFacets   4/9/4/2
# NumGroups/NumMaterials/NumRegions   1/1/0
# x/y/color/ppu   640/320/0/1.00000000

v -0.80512398  0.21356300  0.76134598
v -0.78923601  0.30919600  0.77591699
v -0.77485198  0.29935700  0.81732601
v -0.78485203  0.22935700  0.80732602

vt -0.38052213  1.00000000    <--unused
vt  0.46231049  0.02500000
vt  0.97499996  0.48888922
vt  0.02500000  0.97499996
vt -0.38052213  1.00000000    <--unused
vt  0.46231049  0.02500000    <--unnecessary
vt  0.97499996  0.48888922    <--unnecessary
vt  0.46231043  0.69265592
vt -0.38052213  1.00000000    <--unused

vn  0.83070999  0.46008500  0.31343701
vn  0.84070998  0.47008500  0.32343701
vn  0.89709097 -0.42746699 -0.11180300
vn  0.79720998  0.25963601 -0.54501897

g Figure 1
usemtl cube2_auv
f 1/2/1 2/3/2 3/4/3
f 1/6/1 2/7/2 4/8/4


Post a reply to this message

From: triple r
Subject: Re: UV mapping?
Date: 4 May 2005 15:30:01
Message: <web.42792262efd573f09c7de2fb0@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> Hey, that's something I could have use for as well! The modeller I'm using,
> Silo, doesn't have proper UV-support yet (still under development), but I
> can export to obj and map it with UV-Mapper Classic. I know that I can use
> Poseray to convert the obj to mesh2, and I know that I could just as well
> write a small app for the entire thing myself if I'd get around to install
> C++ and work myself into the language a little... BUT studies leave me
> little spare time, and since you've already written a small app for it...

Yeah, studies leave me little spare time too, but that doesn't stop me.  I
should be cramming for finals right now, but frankly I don't feel like it.

But as far as the program goes, it's in pretty rough shape.  It's only been
tested with one file and has no support for uv yet.  Also, it's just a
command-line program, so it looks like you'd still have to install C++
unless you have a mac.  It has potential to be pretty flexible since it
reads the file once to see what the mesh looks like (number of normals,
vertices, faces [uv-vectors soon]), then reads it again and stores it into
arrays.  Then it writes it to a mesh2 file.  This means it would be pretty
easy to do anything along the way like a custom uv-mapping scheme.  That's
the plan right now (well for Friday - after finals - anyway).

 - Ricky


Post a reply to this message

From: Tim Nikias
Subject: Re: UV mapping?
Date: 4 May 2005 15:46:56
Message: <427926b0$1@news.povray.org>
> But as far as the program goes, it's in pretty rough shape.  It's only
been
> tested with one file and has no support for uv yet.  Also, it's just a
> command-line program, so it looks like you'd still have to install C++
> unless you have a mac.  It has potential to be pretty flexible since it
> reads the file once to see what the mesh looks like (number of normals,
> vertices, faces [uv-vectors soon]), then reads it again and stores it into
> arrays.  Then it writes it to a mesh2 file.  This means it would be pretty
> easy to do anything along the way like a custom uv-mapping scheme.  That's
> the plan right now (well for Friday - after finals - anyway).

Ah, so you're on a Mac. Well, then I'll have to get C++ et al installed and
maybe do a hands on approach myself (I'm the kind of guy that neary *always*
tries to do things himself :-). For a current course I should be thinking
about getting Visual Studio and get C++, OpenGL, OpenInventor and QT
installed and running... Sigh.

Thanks for the response though. Reading the file once and then doing a
second pass while writing/storing the data would have been exactly what I'd
have done, if I'd programmed it. :-)

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: triple r
Subject: Re: UV mapping?
Date: 4 May 2005 17:35:01
Message: <web.42793f81efd573f0b0f2244e0@news.povray.org>
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> Ah, so you're on a Mac. Well, then I'll have to get C++ et al installed and
> maybe do a hands on approach myself (I'm the kind of guy that neary *always*
> tries to do things himself :-).

I can still send you the code (just one file - nothing special) and it's
pretty straightforward to modify it to your liking.  Just let me take a few
finals first.

 - Ricky


Post a reply to this message

From: Jim Charter
Subject: Re: UV mapping?
Date: 4 May 2005 20:31:57
Message: <4279697d$1@news.povray.org>
triple_r wrote:

 > Jim Charter <jrc### [at] msncom> wrote:
 >
 >> I am a little reluctant to comment here since I have yet to produce a
 >> uvmapped result of professional quality but here is the direction I've
 >> gone in fwiw.
 >
 >
 >
 > That's alright.  I have yet to produce... much of anything.
 >
 >
 >> The thing I like to do is to export the unsmoothed cage to Uvmapper (via
 >
 >
 > .... (no reason to quote the whole thing)
 >
 > Maybe it's my problem then because I can't figure out how to get 
UVMapper to
 > do more than display the points and faces.  I can move faces around, but
 > then they just sit there, disconnected from the rest of the mesh.


Yes, that is the behavior.  With "face selection" the selected geometry 
is detached.  You need to use "point selection".  That allows you to 
"pull" the points around thereby stretching and unfolding the geometry 
and hopefully gain a more favorable allignment between the poly and the 
texture.



  The

 > weld, etc. commands don't seem to do anything (it's the mac version 
if that
 > makes a difference.)


Afaik the weld will rejoin points where the projection had separated 
them. In effect, the projection created duplicate points in separate 
places for what is really a common vertex.  These points should be 
highlighted in green when the mating points are selected.  I think they 
need to be dragged into proximity with each other, selected, then welded.


It's probably pretty obvious that the solution is to

 > uv-map right away when it's not too complex rather than at the end.


I think it makes sense to work with the "cage" rather than the smoothed 
mesh when establishing the uv's, as I described before.  It is simpler, 
and conceptually you are still in the manual phase.  Once you smooth the 
mesh it is usually too complex to be dragging points, and anyway, now it 
is a mechanically derived thing.  The trick is to get the model, with 
uv's applied, back into another program for smoothing.  As I said, to do 
this in Wings the model needs to be a single group or else Wings will 
try to make separate objects out of each group, usually to deleterious 
result.  Once the model is smoothed in Wings, it can be reloaded into 
Uvmapper and the projection will correspond to the shape of the one you 
generated previously.


  I

 > think that's my whole problem in the first place.  I held off though 
since
 > the last thing I did was to break the virtual mirror in Wings3D so I only
 > had to work on half of the model.  UV mapping before it is actually
 > mirrored seems pointless.  By that time the model is complex enough 
that I
 > couldn't have done it symmetrically without a virtual mirror, but too
 > complex to feasibly shift vertices around by hand in the small window 
of UV
 > Mapper or the painfully slow AutoUV of Wings3D.  Is there a simple 
solution
 > to this dillema?  Do regions and materials make it that much easier?  Is
 > the map discontinuous then?


Well, shifting the points is always a tedious process but as long as you 
are still in manual phase you shouldn't have made insurmountable 
complexity.  I believe it has been my practice to apply the uv's fairly 
early on once the princple shapes and components are established, and 
before I add a lot of detail, then import back into Wings and continue 
working.  When I work I usally freeze and reapply the mirror frequently 
and I believe the uv's are retained but I cannot test this claim at the 
moment. I am rebuilding my system and have not yet put uvmapper back. 
Maybe I will get to it later tonight.


 >
 > My other problem with UVMapper is the inefficiency.  The file below shows
 > the .obj output from UVMapper.  Four vertices (v) and four normals (vn)
 > went in, four vertices, four normals, and nine uv vectors (vt) came out?!
 > Notice the duplication.  It doesn't even use the first, fifth, or ninth
 > uv-vector (the middle indices in the face list).  So in the end, it uses
 > six of nine vectors where only four are necessary.  This doesn't 
happen at
 > all if I do it myself.  This isn't a big problem since the final 
result is
 > the same, but for large meshes, that can slow things down a bit.  Not 
that
 > I'm in a huge hurry, but I still have things to be doing...  Why 
would they
 > do this?
 >
 >  - Ricky
 >
 > # file generated by UVMapper
 > # NumVerts/NumTVerts/NumVNormals/NumFacets   4/9/4/2
 > # NumGroups/NumMaterials/NumRegions   1/1/0
 > # x/y/color/ppu   640/320/0/1.00000000
 >
 > v -0.80512398  0.21356300  0.76134598
 > v -0.78923601  0.30919600  0.77591699
 > v -0.77485198  0.29935700  0.81732601
 > v -0.78485203  0.22935700  0.80732602
 >
 > vt -0.38052213  1.00000000    <--unused
 > vt  0.46231049  0.02500000
 > vt  0.97499996  0.48888922
 > vt  0.02500000  0.97499996
 > vt -0.38052213  1.00000000    <--unused
 > vt  0.46231049  0.02500000    <--unnecessary
 > vt  0.97499996  0.48888922    <--unnecessary
 > vt  0.46231043  0.69265592
 > vt -0.38052213  1.00000000    <--unused
 >
 > vn  0.83070999  0.46008500  0.31343701
 > vn  0.84070998  0.47008500  0.32343701
 > vn  0.89709097 -0.42746699 -0.11180300
 > vn  0.79720998  0.25963601 -0.54501897
 >
 > g Figure 1
 > usemtl cube2_auv
 > f 1/2/1 2/3/2 3/4/3
 > f 1/6/1 2/7/2 4/8/4
 >
 >
 >


Interesting.  Can't help you there though I know there are several 
utilities in the program that I haven't yet explored the purpose of.


Post a reply to this message

From: Jim Charter
Subject: Re: UV mapping?
Date: 4 May 2005 22:09:50
Message: <4279806e$1@news.povray.org>
Okay, I reinstall Uvmapper and tested what I said and it doesn't hold 
up. :( If, after creating the UV's and importing back into Wings, you 
divide the model and use the mirror then refreeze and export, the uv's 
are only preserved for half the model.  The mirror freeze does not 
reflect the uv's.  Soooo yes, you have to be pretty careful about when 
you do the freeze and create the uv's.  Best to do it just before 
smoothing I guess.

I was wrong about "weld" too.:(  I think I was describing "stitch"


Post a reply to this message

From: Thomas Baier
Subject: Re: UV mapping?
Date: 24 May 2005 06:44:12
Message: <441691tqm6cfi2heg6rm9u2m2n8qdn7tk6@4ax.com>
On Wed,  4 May 2005 12:31:25 EDT, "triple_r" <nomail@nomail> wrote:

Maybe you have a look at Rheingold3d (tb-software.com).

UV Mapping capabilities are described here:
http://www.tb-software.com/rheingold3d/rh3_help/index.html ->
Modifying Objects -> Mesh -> Mesh Tools -> UV Mapping

and here:
-> UVFace/UVVertex Editing

Rheingold3D preserves your uv mapping even if you subdivide your
model.

-tb


>I got a little sidetracked and started playing around with Wings3D (on a
>mac).  The program works great, but I couldn't get the pov export plugin to
>work, so I wrote a program to parse a .obj file and output mesh2.
>
>The problem is when I try to use uv-mapping.  It doesn't work too well in
>Wings3D - so I figure either it doesn't work too well or I don't know how
>to work it - so I tried the free UV Mapper program.  At best, that just
>does spherical mapping that I could do right in POV-Ray anyway.  Wings3D is
>really slow for complicated models and gives a lot of overlap and ugliness
>when it does work.  I have a suspicion that what I should have done is
>UV-map it from the start, then create the model.  But it's too late for
>that.  The topology of the model is spherical, but there is some overlap
>so, as seen in p.b.i., parts around the eyes and neck get pretty distorted.
>
>My current plan is to get my program to find uv vectors with spherical
>mapping then some kind of pseudo-mass-spring model to clear up the rough
>spots, but I'm pretty lost on this one.  I've never really done any mesh
>modeling before, so I'm not really sure how it should work.  Any help?
>
> - Ricky
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.