POV-Ray : Newsgroups : povray.newusers : object parameters : Re: object parameters Server Time
20 Apr 2024 01:10:31 EDT (-0400)
  Re: object parameters  
From: Alain Martel
Date: 13 Feb 2023 12:23:39
Message: <63ea721b$1@news.povray.org>
Le 2023-02-13 à 11:26, seNex a écrit :
> is there a way to get the parameter of an object after its declaration? For
> example if I create a sphere named mysphere with center <x,y,z> and radius 1,
> can I use a
> function to write these to new variables? Like:
> 
> 
> #declare mysphere=sphere{<x,y,z>,1};
> 
> #declare sphere_center=centerfunction(mysphere);
> #declare sphere_radius=radiusfunktion(mysphere);
> 
> 

There are no such function. Those values are never visible from the SDL 
perspective. The recommended thing to do is to declare the centre and 
radius then to use those declared value when you #declare your object :

#declare Sphere_centre= Some_location;
#declare Sphere_radius= Some_Radius;
#declare Mysphere=sphere{Sphere_centre, Sphere_radius}


Post a reply to this message

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