POV-Ray : Newsgroups : povray.general : SDL Access to Already Declared Objects? : Re: SDL Access to Already Declared Objects? Server Time
3 Aug 2024 08:15:31 EDT (-0400)
  Re: SDL Access to Already Declared Objects?  
From: Chambers
Date: 22 Mar 2004 14:55:50
Message: <405f44c6$1@news.povray.org>
"ABX" <abx### [at] abxartpl> wrote in message
news:uqau509fp9s1aq67kkr6buhg3amup6lc0h@4ax.com...
> On Mon, 22 Mar 2004 10:04:40 -0800, "Chambers" <bdc### [at] yahoocom>
wrote:
> > How difficult would it be to allow SDL access to predeclared objects?
>
> Not difficoult at all if you encapsulate input data and object in one
> structure and operate on it.
>
http://news.povray.org/povray.advanced-users/thread/%3C6lpkut0vdh0h6gljr7u2v4mip6olddkmel%404ax.com%3E/

Hmm, I've used a similar method, but this again requires that you declare
your objects in #declare 's and then operate on those.

Say we have the following:

sphere {0,1 pigment {color red 1} }

#declare struct=array[3];
#declare struct[0]=sphere{y*2,1 pigment {color blue 1} }
#declare struct[1]=finish {reflection 1};
#declare struct[2]=sphere{x*2,1 pigment {color green 1} }

(I know it's a crude example, but let's keep things simple :)

OK, now in the struct we have two spheres and a finish because we declared
them.  Fine, we can access those.  For the purposes of the example, let's
say I'm doing collision detection (though this would be useful for much more
than that).  I can check against the blue and green spheres as parts of the
struct.  However, how can I check for collision against the red sphere?  In
fact, how do I know there aren't other objects in the scene that aren't part
of the struct?  I'd like a method for POV-Ray to let me *see* them (but not
necessarily change them) and their internal data.

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


Post a reply to this message

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