POV-Ray : Newsgroups : povray.general : A new SDL Idea : Re: A new SDL Idea Server Time
31 Jul 2024 12:16:29 EDT (-0400)
  Re: A new SDL Idea  
From: Bruno Cabasson
Date: 17 Oct 2007 15:50:00
Message: <web.47166718bcc3cc0276e65db0@news.povray.org>
Bryan Valencia <209### [at] gmailcalm> wrote:
> Warp wrote:
> > Bruno Cabasson <bru### [at] alcatelaleniaspacefr> wrote:
> >> In order to keep current syntax spirit, I would rather propose something
> >> like:
> >
> >   The problem is that it hard-codes that the imported object is a mesh.
> > (Can .obj files contain other things too, such as NURBS or whatever?)
> >
>
> No it's not associating ".obj" with meshes.  if you want to import a
> NURB, then you would use the POVNurb.loadfromobj("nurbfile.obj");
>
> Maybe better for the mesh would be
> POVMesh.LoadFromWavefrontObj("somefile.obj");
>
>
> --
> Bryan Valencia
>
I agree that the 'load' method is specific to the type of object involved.
However, your notation does not appear to me as POV-like. For me, it would
rather be:

nurbs
{
    load_file {obj "my_2cv.obj" [nurbs-specific modifiers]}
    ...
}

and

mesh
{
    load_file {obj "victoria.obj" [mesh-specific modifiers]}
    ...
}


Bruno

PS: These lines would invoke internally (once compiled or while interpreted)
some methods like you say:

POVNurb.loadfromobj("my_2cv.obj"); // Or through an instance of POVNurb
class
POVMesh.loadfromobj("victoria.obj"); // Or through an instance of POVMesh
class

but internally only.


Post a reply to this message

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