Magnatune: We
Are Not Evil
  POV-Ray : Newsgroups : povray.pov4.discussion.general : True objects in SDL? Server Time: 24 Jul 2008 20:49:20 GMT
  True objects in SDL? (Message 1 to 5 of 5)  
From: Chambers
Subject: True objects in SDL?
Date: 3 Feb 2008 04:09:09
Message: <47a53e65@news.povray.org>
What are the odds of this?

For instance, if I define a sphere{}, and pass it as an argument to 
something, I'd like that function to have access to information about 
the sphere.  Both shape specific (ie, center and radius), as well as 
generic (texture / transformations).

Once this is possible, then it's a trivial step to add a "world" or 
"scene" object which is simply a union of everything.

And that makes all kinds of fun tricks available ;)

---
On a separate note, I was looking at Thomas de Groot's image in p.b.i, 
"Ruined Place", and reading Jim's reply about moss growing where the sun 
doesn't reach.  Giving SDL access to more POV-Ray internals would enable 
things like asking POV to gather radiosity (or even simple lighting) 
samples at a particular point and return the result, allowing a scripted 
application of moss in the shade...

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Warp
Subject: Re: True objects in SDL?
Date: 3 Feb 2008 08:03:12
Message: <47a57540@news.povray.org>
Chambers <ben [at] pacificwebguycom> wrote:
> What are the odds of this?

  One of the main points of pov4 is that it should have a better scripting
language.

-- 
                                                          - Warp


Post a reply to this message

From: Chambers
Subject: Re: True objects in SDL?
Date: 3 Feb 2008 08:44:53
Message: <47a57f05$1@news.povray.org>
Warp wrote:
> Chambers <ben [at] pacificwebguycom> wrote:
>> What are the odds of this?
> 
>   One of the main points of pov4 is that it should have a better scripting
> language.
> 

Nice :)  But I had to ask, since "a better scripting language" doesn't 
really tell us much, so I wasn't sure if this was being considered or not.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: True objects in SDL?
Date: 3 Feb 2008 14:57:52
Message: <47a5d670$1@news.povray.org>
Both properties and methods. Unions should have an add_object method :)

Now:
union {
     #while(I<10)
         sphere { x*I, 0.1 }
         #declare I=I+1;
     #end
}

Or, in loops which have things much more complex than that (for example 
if you need to trace() all the created spheres in order to create one more):

#declare Obj = union{};
#while(I<10)
     #declare Obj = union { object{Obj} sphere { x*I, 0.1 } };
     #declare I=I+1;
#end

(I heard POV-Ray has a special optimization for this, to make the final 
in-memory CSG be a flat union like from the first example, instead of a 
nested union)

So I'd like:

obj = union{};
while(I<10) {
     obj.add(sphere { x*I, 0.1 });
     I++;
}

(I'm not suggesting this script syntax, just the concept of adding 
objects to already-created CSG structures)


Post a reply to this message

From: scott
Subject: Re: True objects in SDL?
Date: 6 Feb 2008 09:33:23
Message: <47a97ee3@news.povray.org>
>>> What are the odds of this?
>>
>>   One of the main points of pov4 is that it should have a better 
>> scripting
>> language.
>>
>
> Nice :)  But I had to ask, since "a better scripting language" doesn't 
> really tell us much, so I wasn't sure if this was being considered or not.

Ideally it would be good enough that we wouldn't have to use another 
language to generate POV code.  I regularly use C++ to generate POV code, 
just because the SDL is too slow and clumsy for dealing with arrays of 
objects for animation.  It's a shame because it would be much nicer to be 
able to do that stuff within POV itself.


Post a reply to this message

Copyright 1991-2004 POV-Team™