POV-Ray : Newsgroups : povray.general : SDL Access to Already Declared Objects? : Re: SDL Access to Already Declared Objects? Server Time
3 Aug 2024 08:09:04 EDT (-0400)
  Re: SDL Access to Already Declared Objects?  
From: Chambers
Date: 23 Mar 2004 16:22:07
Message: <4060aa7f@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cjameshuff-6795B5.07440523032004@news.povray.org...
> In article <405f2a3f$1@news.povray.org>,
>  "Chambers" <bdc### [at] yahoocom> wrote:
>
> > How difficult would it be to allow SDL access to predeclared objects?
Ie,
> > you'd use something like this:
> >
> > #declare obj = firstObject;
> >
> > // obj is now a reference to the first declared object
> >
> > #declare loc = obj.location;
>
> obj has a location? What's the location of an infinite plane? Or a julia
> fractal?

The location of all objects is <0,0,0> until acted on by translations /
rotations.  The final location is the sum of these transformations.

> > #declare pig = obj.texture.pigment;
> > #declare med = obj.interior.media;
>
> Which media? You can have more than one.

True.  Multiple textures / medias aren't something I tend to go for,
though - I prefer a nice ordered hierarchy.  Of course, that doesn't mean it
isn't possible, and any solution would need to account for that.

> > I'm not interested in changing the objects already declared, just in
getting
> > information about them.  I don't see that there would be any technical
> > difficulties, and it would be hugely advantageous for particle
simulations,
> > among other things.
>
> It would require writing a lot of special code for each object type, and
> as already mentioned, the specified object parameters may no longer
> exist in the same form, and some things can exist in multiple forms. You


But don't all objects share certain parameters, such as texture, location,
etc?

> could parse objects into an intermediate structure to avoid that
> problem, and make it a structure of the script language to allow both
> reading as in your examples and modification. This would be the best
> way, but would be a large amount of work. It would be useful in other
> ways though, if one were able to define custom structures. It wouldn't
> need to be a full fledged object oriented system, but that would really
> help.

Structures would be useful in and of themselves, but that's another topic.

-- 
...Chambers
http://www.geocities.com/bdchambers79


Post a reply to this message

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