POV-Ray : Newsgroups : povray.unofficial.patches : Showing two shiny spheres. Server Time
14 May 2024 05:12:43 EDT (-0400)
  Showing two shiny spheres. (Message 1 to 3 of 3)  
From: Greg M  Johnson
Subject: Showing two shiny spheres.
Date: 28 Oct 2004 22:29:34
Message: <4181ab0e$1@news.povray.org>
In a thread I brought up elsewhere,  Christoph suggested:

<< For two spheres you just do:

#declare Start_Idx1=mechsim:face_count;
MechSim_Generate_Sphere(...)
#declare Start_Idx2=mechsim:face_count;
MechSim_Generate_Sphere(...)


and later:

MechSim_Show_Sphere(Start_Idx1, Start_Idx2-Start_Idx1, ...)
MechSim_Show_Sphere(Start_Idx2, mechsim:face_count-Start_Idx2, ...)
>>

However, the _Generate_Sphere _ code would only be used in frame 1, and you 
need to show the objects on frames 2 through the end.

I know I'm truly ignorant here, but I'm tempted to ask if it is a limitation 
of the mechsim system that it cannot work with more than one sphere and make 
them both shiny.  Or you have to do some arithmetic on paper to figure out 
the numbers that the Idx variables would represent.


Post a reply to this message

From: Christoph Hormann
Subject: Re: Showing two shiny spheres.
Date: 29 Oct 2004 04:15:02
Message: <clsu3s$1o0$1@chho.imagico.de>
Greg M. Johnson wrote:
> In a thread I brought up elsewhere,  Christoph suggested:
> 
> << For two spheres you just do:
> 
> #declare Start_Idx1=mechsim:face_count;
> MechSim_Generate_Sphere(...)
> #declare Start_Idx2=mechsim:face_count;
> MechSim_Generate_Sphere(...)
> 
> 
> and later:
> 
> MechSim_Show_Sphere(Start_Idx1, Start_Idx2-Start_Idx1, ...)
> MechSim_Show_Sphere(Start_Idx2, mechsim:face_count-Start_Idx2, ...)
> 
> 
> However, the _Generate_Sphere _ code would only be used in frame 1, and you 
> need to show the objects on frames 2 through the end.

For the other frames you would need to write the numbers to a file.  A 
set of MechSim_Write_Index()/MechSim_Read_Index() macros could be useful 
but is fairly straight away to write.  You can also simply print the 
numbers in the message window using #debug and insert them manually. 
This is not a flaw in the system but completely intentional.  It is the 
only way it can work.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Andy Cocker
Subject: Re: Showing two shiny spheres.
Date: 29 Oct 2004 06:32:39
Message: <41821c47$1@news.povray.org>
> For the other frames you would need to write the numbers to a file.  A
> set of MechSim_Write_Index()/MechSim_Read_Index() macros could be useful
> but is fairly straight away to write.  You can also simply print the
> numbers in the message window using #debug and insert them manually.
> This is not a flaw in the system but completely intentional.  It is the
> only way it can work.

Yes, as Christoph says, I find by far the easiest way (for me) is to #debug the
numbers to the
message window. Inserting them manually for just two spheres takes seconds, and unless
you
change the topology only needs to be done once.

In fact, the easiest way would be to #declare the numbers outside of topology
generation
rather than insert them into the MechSim_Show_Sphere() macro directly. So..:

#declare Start_Idx1=0;// Add number returned from #debug here
#declare Start_Idx2=80;// Add number returned from #debug here

//Then..

MechSim_Show_Sphere(Start_Idx1, Start_Idx2-Start_Idx1, ...)
MechSim_Show_Sphere(Start_Idx2, mechsim:face_count-Start_Idx2, ...)

...would work

Andy


Post a reply to this message

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