POV-Ray : Newsgroups : povray.advanced-users : POVRay scene to obj format Server Time
23 Dec 2024 02:15:38 EST (-0500)
  POVRay scene to obj format (Message 1 to 2 of 2)  
From: handos
Subject: POVRay scene to obj format
Date: 22 Oct 2012 19:05:00
Message: <web.5085d0e6a456236310a6184e0@news.povray.org>
Hi everyone,

I am looking to convert a POVRay scene to obj file format. Are there are any
easy ways to do that? If yes, could anyone please send me some pointers to that?

Thank you.


Post a reply to this message

From: Patrick Elliott
Subject: Re: POVRay scene to obj format
Date: 22 Oct 2012 23:01:43
Message: <50860897$1@news.povray.org>
On 10/22/2012 4:04 PM, handos wrote:
> Hi everyone,
>
> I am looking to convert a POVRay scene to obj file format. Are there are any
> easy ways to do that? If yes, could anyone please send me some pointers to that?
>
> Thank you.
>
>
Strictly speaking, no. You are dealing with two different ways of 
handling things. POVRay computes things using pure math, obj is an 
"approximation". While there have been some limited methods people have 
come up with to do what is called tessellation, which can, in principle, 
produce such an approximation, it can only reproduce the general shape, 
if even that, of the objects, and it would probably take, in some cases, 
less time to design the obj in a regular modelling program than it would 
take to build in POVRay, then translate its results into something else.

This may not always be the case though. One things standard modeller do 
very badly is CSG. Even some that do, tend to be buggy. Its easy to use 
pure math to figure out the transition points for such combined objects, 
or cuts outs, or intersections, but when you try to do that with a mesh, 
like in an obj file, things go wrong almost as often as they go right. 
So.. There have been a few cases where it almost would have been easier 
to design something in POVRay, then convert. Most of the time, not so much.

However, this also just gets you the mesh, if you had a converter. The 
biggest benefit POVRay could be said to have is the texture system. 
And.. There is nothing out that I have ever heard of that can generate 
both the mesh tessellation of POVRay builds, but also generate a UV map, 
and a texture, to go with them. In fact, to do it right, it might even 
have to generate a bump map too. For example, a sphere is one single 
smooth object in POVRay. In mesh it might be 640 triangles. Even if you 
tessellated the perfectly round one into 640 triangles, and somehow 
mapped the texture to the result, up close it would still not look 
curved enough, because you would have flat surfaces every place. A bump 
map would fix that, at least every place where you couldn't see the edge 
of the object. But, that is taking one line, like:

sphere {<0,0,0>, 100 texture{ Polished_Chrome pigment{ color 
rgb<1,0.8,0>} normal { crackle 0.75 turbulence 0.25 scale 0.25} finish { 
diffuse 0.9}}

And turning it into thousands of vertex definitions, a whole mess of UV 
coordinates, and at least 2, possibly more, files, defining the texture, 
bump, etc.

And, again, there is jack all that can do anything, as far as I know, 
beyond just making an untextured mesh, that is more or less like what 
you started with.


Post a reply to this message

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