POV-Ray : Newsgroups : povray.advanced-users : "Unwrap" a mesh object Server Time
24 Nov 2024 04:26:21 EST (-0500)
  "Unwrap" a mesh object (Message 1 to 3 of 3)  
From: SharkD
Subject: "Unwrap" a mesh object
Date: 10 Apr 2009 20:35:23
Message: <49dfe5cb$1@news.povray.org>
I know it's possible to "unwrap" 3D meshes made in other applications 
such that the resulting object is completely flat. See this for example:

http://paperstarships.tengun.net/

However, is it also possible to do this with POV-Ray objects 
(specifically, polygonal or mesh-based ones)? The reason I ask is that I 
have a mesh object with materials and so forth assigned to it, and I 
would like to "fabricate" a texture for it that I can then import into 
another program.

-Mike


Post a reply to this message

From: clipka
Subject: Re: "Unwrap" a mesh object
Date: 10 Apr 2009 21:55:01
Message: <web.49dff7b2e8063569722e13220@news.povray.org>
SharkD <mik### [at] gmailcom> wrote:
> I know it's possible to "unwrap" 3D meshes made in other applications
> such that the resulting object is completely flat. See this for example:
>
> http://paperstarships.tengun.net/
>
> However, is it also possible to do this with POV-Ray objects
> (specifically, polygonal or mesh-based ones)? The reason I ask is that I
> have a mesh object with materials and so forth assigned to it, and I
> would like to "fabricate" a texture for it that I can then import into
> another program.

If I understand your problem correctly, you have a POV mesh object, with a POV
procedural texture, both of which you want to import into some other modeller.

I actually did (almost) exactly that for a TC-RTC shot:
http://www.tc-rtc.co.uk/imagenewdisplay/stills/index185.html
This is a checker-pattern composition of a POV-Ray shot and a rasterized version
of the same scene. Note the marble textures The marble textures on the pawns:
These are genuine POV textures, which for the rasterized pieces had to be
"snapshot" into UV-mappable texture images.

Here's the workflow I used:

* My models were initially Wings 3D models; if you only have the POV meshes,
PoseRay will probably help you extract them to, say, .obj format.

* Next step was to create a UV mapping for the models; if your models already
have UV co-ordinates attached, then you can skip this one. Otherwise, Wings 3D
or similar programs will happily support you with the task of generating a more
or less low-distortion UV mapping. When done, export to .obj format again.

* Now we're heading for the fun part: I wrote a simple C# program that would
parse an .obj file, and generate from it a POV scene with a host of triangles:
Each placed normally in 3D space as described in the .obj files, equipped with
the desired texture, and then individually pushed around and distorted to end
up at the UV co-ordinates in the XY plane. Add an orthographic camera, render
at high resolution, and voila - POV spits out a snapshot of the texture, ready
to be UV-mapped to your .obj!

* As one last step, to make sure that no seams will be visible, load the texture
into an image processing software, and "bleed" the triangle colours into the
background.


If you like, I'd be willing to make the C# program available.


Post a reply to this message

From: SharkD
Subject: Re: "Unwrap" a mesh object
Date: 11 Apr 2009 00:19:59
Message: <49e01a6f$1@news.povray.org>
clipka wrote:
> SharkD <mik### [at] gmailcom> wrote:
>> I know it's possible to "unwrap" 3D meshes made in other applications
>> such that the resulting object is completely flat. See this for example:
>>
>> http://paperstarships.tengun.net/
>>
>> However, is it also possible to do this with POV-Ray objects
>> (specifically, polygonal or mesh-based ones)? The reason I ask is that I
>> have a mesh object with materials and so forth assigned to it, and I
>> would like to "fabricate" a texture for it that I can then import into
>> another program.
> 
> If I understand your problem correctly, you have a POV mesh object, with a POV
> procedural texture, both of which you want to import into some other modeller.
> 
> I actually did (almost) exactly that for a TC-RTC shot:
> http://www.tc-rtc.co.uk/imagenewdisplay/stills/index185.html
> This is a checker-pattern composition of a POV-Ray shot and a rasterized version
> of the same scene. Note the marble textures The marble textures on the pawns:
> These are genuine POV textures, which for the rasterized pieces had to be
> "snapshot" into UV-mappable texture images.
> 
> Here's the workflow I used:
> 
> * My models were initially Wings 3D models; if you only have the POV meshes,
> PoseRay will probably help you extract them to, say, .obj format.
> 
> * Next step was to create a UV mapping for the models; if your models already
> have UV co-ordinates attached, then you can skip this one. Otherwise, Wings 3D
> or similar programs will happily support you with the task of generating a more
> or less low-distortion UV mapping. When done, export to .obj format again.
> 
> * Now we're heading for the fun part: I wrote a simple C# program that would
> parse an .obj file, and generate from it a POV scene with a host of triangles:
> Each placed normally in 3D space as described in the .obj files, equipped with
> the desired texture, and then individually pushed around and distorted to end
> up at the UV co-ordinates in the XY plane. Add an orthographic camera, render
> at high resolution, and voila - POV spits out a snapshot of the texture, ready
> to be UV-mapped to your .obj!
> 
> * As one last step, to make sure that no seams will be visible, load the texture
> into an image processing software, and "bleed" the triangle colours into the
> background.
> 
> 
> If you like, I'd be willing to make the C# program available.
> 
> 
> 

Awesome! That is *exactly* what I had in mind. Any chance of releasing 
that C# program? :)

-Mike

PS: I wonder how we could handle all the other possible OBJ texture 
types, such as specularity, glow, etc.?


Post a reply to this message

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