POV-Ray : Newsgroups : povray.beta-test : Wavefront OBJ import Server Time
28 Mar 2024 08:28:02 EDT (-0400)
  Wavefront OBJ import (Message 1 to 10 of 31)  
Goto Latest 10 Messages Next 10 Messages >>>
From: clipka
Subject: Wavefront OBJ import
Date: 13 Sep 2016 20:08:07
Message: <57d894e7$1@news.povray.org>
Source code:

https://github.com/c-lipka/povray/tree/feature/obj_import

Syntax is as follows:

    mesh {
      obj FILENAME
      [ OBJ_TEXTURE_LIST ]
      [ inside_vector VECTOR ]
    }

    OBJ_TEXTURE_LIST:
      texture_list {
        [ OBJ_TEXTURE_LIST_ITEM ... ]
      }

    OBJ_TEXTURE_LIST_ITEM:
      STRING texture { TEXTURE } |   (A)
      STRING material { TEXTURE } |
      prefix STRING |                (B)
      suffix STRING

At present, associated .mtl files will /not/ be evaluated; instead,
textures must be defined using one of the following means:

(A) in the texture_list, as a list of the individual material names as
used in the .obj file and the respective texture definition to use; or

(B) before the `mesh` statement, by defining texture variables with
corresponding names. For some ease of use, a pre- and suffix can be
defined that will be added to the material name as used in the .obj file.

For additional ease of use, materials can be used instead of textures;
however, in that case only the texture is taken from the material, while
the interior_texture and interior are ignored.


e.g.

    #declare MyTexture = texture { ... }
    #declare MyMaterial = material { ... }

    mesh {
      obj "MyMesh.obj"
      texture_list {
        "Foo" texture { MyTexture }
        "Bar" material { MyMaterial }
        prefix "Tx"
        suffix "_"
      }
      inside_vector y
    }

will map the material name "Foo" in the .obj file to `MyTexture` and the
material name "Bar" to `MyMaterial`, while any other name, say, `Fnord`
or `Uqbar`, would be mapped to `TxFnord_` and `TxUqbar_`, respectively.


OBJ import provides rudimentary support for non-triangular polygons, but
currently just blindly cuts up such polygons into triangles, relying on
the polygons to be nicely planar and convex. This may also affect the
apparent curvature of such polygons.


That said, I have a hunch that someone might like this feature.


Post a reply to this message

From: Bill Pragnell
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 01:20:00
Message: <web.57d8ddb5d98a4381a1334c0c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
[snip]

Excellent! This will be very useful. Almost everything can export to obj, so
this immediately improves workflow for any project that uses a third-party
modeller.

Presumably the slight increase in read speed over mesh2 stems from the fact that
..obj is slightly less verbose in its syntax?

Bill


Post a reply to this message

From: clipka
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 03:39:51
Message: <57d8fec7$1@news.povray.org>
Am 14.09.2016 um 07:18 schrieb Bill Pragnell:
> clipka <ano### [at] anonymousorg> wrote:
> [snip]
> 
> Excellent! This will be very useful. Almost everything can export to obj, so
> this immediately improves workflow for any project that uses a third-party
> modeller.

That of course depends on the quality of the exporter. If it exports
poor meshes, with flipped normals and stuff, an external tool like
PoseRay is still recommended.


> Presumably the slight increase in read speed over mesh2 stems from the fact that
> ...obj is slightly less verbose in its syntax?

Exactly.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 16:10:19
Message: <57d9aeab$1@news.povray.org>
On 9/13/2016 8:08 PM, clipka wrote:
> That said, I have a hunch that someone might like this feature.
>

It's been documented: http://wiki.povray.org/content/Reference:Mesh

I also created a talk page in case it's needed.


Post a reply to this message

From: clipka
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 16:40:42
Message: <57d9b5ca$1@news.povray.org>
Am 14.09.2016 um 22:10 schrieb Jim Holsenback:
> On 9/13/2016 8:08 PM, clipka wrote:
>> That said, I have a hunch that someone might like this feature.
>>
> 
> It's been documented: http://wiki.povray.org/content/Reference:Mesh
> 
> I also created a talk page in case it's needed.

Thanks; I guess I'll have to hurry to integrate it into the official
branch then ;)


Post a reply to this message

From: Jim Holsenback
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 17:43:40
Message: <57d9c48c$1@news.povray.org>
On 9/14/2016 4:40 PM, clipka wrote:
> Am 14.09.2016 um 22:10 schrieb Jim Holsenback:
>> On 9/13/2016 8:08 PM, clipka wrote:
>>> That said, I have a hunch that someone might like this feature.
>>>
>>
>> It's been documented: http://wiki.povray.org/content/Reference:Mesh
>>
>> I also created a talk page in case it's needed.
>
> Thanks; I guess I'll have to hurry to integrate it into the official
> branch then ;)
>
why the limitation of interior when material is used? that would leave 
out a glass object just to name one


Post a reply to this message

From: clipka
Subject: Re: Wavefront OBJ import
Date: 14 Sep 2016 18:52:24
Message: <57d9d4a8$1@news.povray.org>
Am 14.09.2016 um 23:43 schrieb Jim Holsenback:
> On 9/14/2016 4:40 PM, clipka wrote:
>> Am 14.09.2016 um 22:10 schrieb Jim Holsenback:
>>> On 9/13/2016 8:08 PM, clipka wrote:
>>>> That said, I have a hunch that someone might like this feature.
>>>>
>>>
>>> It's been documented: http://wiki.povray.org/content/Reference:Mesh
>>>
>>> I also created a talk page in case it's needed.
>>
>> Thanks; I guess I'll have to hurry to integrate it into the official
>> branch then ;)
>>
> why the limitation of interior when material is used? that would leave
> out a glass object just to name one

Because POV-Ray's architecture currently doesn't support different
interiors in a single primitive (which may not even make much sense),
and OBJ import is currently designed to generate a single mesh.

You can always add an interior to the entire mesh as part of the
OBJECT_MODIFIERS.


Post a reply to this message

From: William F Pokorny
Subject: Re: Wavefront OBJ import
Date: 15 Sep 2016 07:13:30
Message: <57da825a$1@news.povray.org>
On 09/14/2016 04:10 PM, Jim Holsenback wrote:
> On 9/13/2016 8:08 PM, clipka wrote:
>> That said, I have a hunch that someone might like this feature.
>>
>
> It's been documented: http://wiki.povray.org/content/Reference:Mesh
>
> I also created a talk page in case it's needed.
>
Now I know who has the real power to get things into the master branch :-).

FYI - A new object in the "lemon" is in the master branch and not yet 
documented in povray's documentation. Jérôme has some documentation for 
it already on his page at:

   http://wiki.povray.org/content/User:Le_Forgeron#Lemon

Unsure if on yours or Jérôme's todo list. If I can help in some way 
update the docs for the lemon, let me know.

Bill P.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Wavefront OBJ import
Date: 15 Sep 2016 12:03:23
Message: <57dac64b@news.povray.org>
On 9/15/2016 7:13 AM, William F Pokorny wrote:
> FYI - A new object in the "lemon" is in the master branch and not yet
> documented in povray's documentation. Jérôme has some documentation for
> it already on his page at:

it's been added http://wiki.povray.org/content/Reference:Lemon

looks like the opening paragraph could use some help so I also created a 
talk page as well: http://wiki.povray.org/content/Reference_Talk:Lemon


Post a reply to this message

From: William F Pokorny
Subject: Re: Wavefront OBJ import
Date: 15 Sep 2016 12:59:06
Message: <57dad35a$1@news.povray.org>
On 09/15/2016 12:03 PM, Jim Holsenback wrote:
> On 9/15/2016 7:13 AM, William F Pokorny wrote:
>> FYI - A new object in the "lemon" is in the master branch and not yet
>> documented in povray's documentation. Jérôme has some documentation for
>> it already on his page at:
>
> it's been added http://wiki.povray.org/content/Reference:Lemon
>
> looks like the opening paragraph could use some help so I also created a
> talk page as well: http://wiki.povray.org/content/Reference_Talk:Lemon
>

Thanks. I've attempted some descriptive text at:

http://wiki.povray.org/content/Reference_Talk:Lemon

Bill P.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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