POV-Ray : Newsgroups : povray.programming : Creating a hemisphere with tori? Server Time
29 Jul 2024 06:13:48 EDT (-0400)
  Creating a hemisphere with tori? (Message 1 to 5 of 5)  
From: Daniel Sullivan
Subject: Creating a hemisphere with tori?
Date: 20 Aug 1998 18:15:50
Message: <35DC9198.BDEF7983@home.com>
Hi there-

I'm trying to create a 'screen' for my povray bong using tori.
At the same time I'm trying learn how to use povrays programming
directives so I do'nt have to write so many lines of code.
I'm including the code I've already written so you can see what I'm
attempting to do.

/ Persistence of Vision Ray Tracer Scene Description File
// File:screen.pov
// Vers: 3.1
// Desc: screen created with tori
// Date: 8/20/98
// Auth: ArfGrafix



// ==== Standard POV-Ray Includes ====
#include "colors.inc"	// Standard Color definitions
#include "textures.inc"	// Standard Texture definitions
#include "metals.inc"


// Set a color of the background (sky)
background { White }


camera
{
  location  <0.0 , 2.0 ,-5.0>
  look_at   <0.0 , 0.0 , 0.0>
}


// create a regular point light source
light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-20, 40, -20>
}

#declare b_ring =
  torus { 2, .0625 pigment { P_Brass3 } finish { F_MetalC }  }
 
 object { b_ring scale .9 translate .1*y }
 object { b_ring scale .8 translate .2*y }
 object { b_ring scale .7 translate .3*y }
 object { b_ring scale .6 translate .4*y }
 object { b_ring scale .5 translate .5*y }
 object { b_ring scale .4 translate .6*y }
 object { b_ring scale .3 translate .7*y }
 object { b_ring scale .2 translate .8*y }
 object { b_ring scale .1 translate .9*y }

I wrote this piece of code and soon found out that this creates a
conical series of tori...I tried making a while loop to do this, but was
flummoxed by the task of having the while do two different operations.
What I want is series of tori that form a hemisphere rather than a 
cone..that is each torus is a latitudinal strip that trace out a
hemisphere.
Thanks in advance for any helpful input that anyone may have.

Best regards,

Ron Hicks
sig### [at] hotmailcom
http://www.geocities.com/SoHo/1006


Post a reply to this message

From: PoD
Subject: Re: Creating a hemisphere with tori?
Date: 20 Aug 1998 20:59:22
Message: <35DCB857.22A@merlin.net.au>
Daniel Sullivan wrote:
> 
> Hi there-
> 
> I'm trying to create a 'screen' for my povray bong using tori.
> At the same time I'm trying learn how to use povrays programming
> directives so I do'nt have to write so many lines of code.
> I'm including the code I've already written so you can see what I'm
> attempting to do.
> 
> / Persistence of Vision Ray Tracer Scene Description File
> // File:screen.pov
> // Vers: 3.1
> // Desc: screen created with tori
> // Date: 8/20/98
> // Auth: ArfGrafix
> 
> // ==== Standard POV-Ray Includes ====
> #include "colors.inc"   // Standard Color definitions
> #include "textures.inc" // Standard Texture definitions
> #include "metals.inc"
> 
> // Set a color of the background (sky)
> background { White }
> 
> camera
> {
>   location  <0.0 , 2.0 ,-5.0>
>   look_at   <0.0 , 0.0 , 0.0>
> }
> 
> // create a regular point light source
> light_source
> {
>   0*x // light's position (translated below)
>   color red 1.0  green 1.0  blue 1.0  // light's color
>   translate <-20, 40, -20>
> }
> 
> #declare b_ring =
>   torus { 2, .0625 pigment { P_Brass3 } finish { F_MetalC }  }
> 
>  object { b_ring scale .9 translate .1*y }
>  object { b_ring scale .8 translate .2*y }
>  object { b_ring scale .7 translate .3*y }
>  object { b_ring scale .6 translate .4*y }
>  object { b_ring scale .5 translate .5*y }
>  object { b_ring scale .4 translate .6*y }
>  object { b_ring scale .3 translate .7*y }
>  object { b_ring scale .2 translate .8*y }
>  object { b_ring scale .1 translate .9*y }
> 
> I wrote this piece of code and soon found out that this creates a
> conical series of tori...I tried making a while loop to do this, but was
> flummoxed by the task of having the while do two different operations.
> What I want is series of tori that form a hemisphere rather than a
> cone..that is each torus is a latitudinal strip that trace out a
> hemisphere.
> Thanks in advance for any helpful input that anyone may have.
> 
> Best regards,
> 
> Ron Hicks
> sig### [at] hotmailcom
> http://www.geocities.com/SoHo/1006

First point, do you want the thickness of the ring to decrease as the
height increases? This is what scaling the object is doing. If not then
try

union
{
  #declare a = .1 #while(a < 1)
  torus { cos(asin(a)),.04 translate y*a }
    #declare a = a+.1 #end
  pigment { P_Brass3 }
  finish { F_MetalC }
}

Note I made the minor radius a bit smaller since it's not being scaled.
On a circle drawn on the XY plane, X is proportional to cos(a) and Y is
proportional to sin(a) so you can derive the angle by asin(a), then get
the X (or major radius in this case) by cos(asin(a)).

If you do want the same as you had but a hemispherical version try

#declare a = .1 #while(a < 1)
	object{b_ring scale cos(asin(a)) translate y*a }
	#declare a = a+.1 #end

Hope this helps.
Cheers, PoD.


Post a reply to this message

From: Robert H  Morrison
Subject: Re: Creating a hemisphere with tori?
Date: 22 Aug 1998 08:31:19
Message: <01bdcdc0$88e70ba0$40563fc3@hitex_mo.hitex.de>
PoD <pod### [at] merlinnetau> schrieb im Beitrag <35D### [at] merlinnetau>...
> Daniel Sullivan wrote:
> > 
> > Hi there-
> > 
> > I'm trying to create a 'screen' for my povray bong using tori.
> > At the same time I'm trying learn how to use povrays programming
> > directives so I do'nt have to write so many lines of code.
> > I'm including the code I've already written so you can see what I'm
> > attempting to do.
> > 
> > [SNIP]
> > 
> > sig### [at] hotmailcom
> > http://www.geocities.com/SoHo/1006
> 
> [SNIP]
> 
> #declare a = .1 #while(a < 1)
> 	object{b_ring scale cos(asin(a)) translate y*a }
> 	#declare a = a+.1 #end
> 

Wouldn't:

	#declare a = 0.1

	#while( a < 1 )
		object{ b_ring scale 1 - a translate y * a }
		#declare a = a + 0.1
	#end

be a lot easier to read (and understand)?
-- 
Best regards,
 _ __                      _    ,   _ _ _
' )  )     /         _/_  ' )  /   ' ) ) )
 /--' ____/___/> __  /     /--/     / / / __,_  __  o _   ______
/  \_(_) /_) (__/ (_<__   /  ( o   / ' (_(_) (_/ (_<_/_)_(_) / <_

Robert H. Morrison                      Tel:   +49 721 9628 167
Software Development, Basis Team        FAX:   +49 721 9628 261
Hitex-Systementwicklung GmbH            Email: RMorrison@hitex.de


Post a reply to this message

From: PoD
Subject: Re: Creating a hemisphere with tori?
Date: 22 Aug 1998 19:42:54
Message: <35DF496D.714C@merlin.net.au>
[snip]
> 
> Wouldn't:
> 
>         #declare a = 0.1
> 
>         #while( a < 1 )
>                 object{ b_ring scale 1 - a translate y * a }
>                 #declare a = a + 0.1
>         #end
> 
> be a lot easier to read (and understand)?
> --
> Best regards,
>  _ __                      _    ,   _ _ _
> ' )  )     /         _/_  ' )  /   ' ) ) )
>  /--' ____/___/> __  /     /--/     / / / __,_  __  o _   ______
> /  \_(_) /_) (__/ (_<__   /  ( o   / ' (_(_) (_/ (_<_/_)_(_) / <_
> 
> Robert H. Morrison                      Tel:   +49 721 9628 167
> Software Development, Basis Team        FAX:   +49 721 9628 261
> Hitex-Systementwicklung GmbH            Email: RMorrison@hitex.de

The point is to make a hemisphere of tori rather than a cone.

Cheers, PoD.


Post a reply to this message

From: Daniel Sullivan
Subject: Re: Creating a hemisphere with tori?
Date: 23 Aug 1998 02:17:47
Message: <35DFA570.D40A1022@home.com>
PoD wrote:
> 
> Daniel Sullivan wrote:
> >
> > Hi there-
> >
> > I'm trying to create a 'screen' for my povray bong using tori.
> > At the same time I'm trying learn how to use povrays programming
> > directives so I do'nt have to write so many lines of code.
> > I'm including the code I've already written so you can see what I'm
> > attempting to do.
> >
> > / Persistence of Vision Ray Tracer Scene Description File
> > // File:screen.pov
> > // Vers: 3.1
> > // Desc: screen created with tori
> > // Date: 8/20/98
> > // Auth: ArfGrafix
> >
> > // ==== Standard POV-Ray Includes ====
> > #include "colors.inc"   // Standard Color definitions
> > #include "textures.inc" // Standard Texture definitions
> > #include "metals.inc"
> >
> > // Set a color of the background (sky)
> > background { White }
> >
> > camera
> > {
> >   location  <0.0 , 2.0 ,-5.0>
> >   look_at   <0.0 , 0.0 , 0.0>
> > }
> >
> > // create a regular point light source
> > light_source
> > {
> >   0*x // light's position (translated below)
> >   color red 1.0  green 1.0  blue 1.0  // light's color
> >   translate <-20, 40, -20>
> > }
> >
> > #declare b_ring =
> >   torus { 2, .0625 pigment { P_Brass3 } finish { F_MetalC }  }
> >
> >  object { b_ring scale .9 translate .1*y }
> >  object { b_ring scale .8 translate .2*y }
> >  object { b_ring scale .7 translate .3*y }
> >  object { b_ring scale .6 translate .4*y }
> >  object { b_ring scale .5 translate .5*y }
> >  object { b_ring scale .4 translate .6*y }
> >  object { b_ring scale .3 translate .7*y }
> >  object { b_ring scale .2 translate .8*y }
> >  object { b_ring scale .1 translate .9*y }
> >
> > I wrote this piece of code and soon found out that this creates a
> > conical series of tori...I tried making a while loop to do this, but was
> > flummoxed by the task of having the while do two different operations.
> > What I want is series of tori that form a hemisphere rather than a
> > cone..that is each torus is a latitudinal strip that trace out a
> > hemisphere.
> > Thanks in advance for any helpful input that anyone may have.
> >
> > Best regards,
> >
> > Ron Hicks
> > sig### [at] hotmailcom
> > http://www.geocities.com/SoHo/1006
> 
> First point, do you want the thickness of the ring to decrease as the
> height increases? This is what scaling the object is doing. If not then
> try
> 
> union
> {
>   #declare a = .1 #while(a < 1)
>   torus { cos(asin(a)),.04 translate y*a }
>     #declare a = a+.1 #end
>   pigment { P_Brass3 }
>   finish { F_MetalC }
> }
> 
> Note I made the minor radius a bit smaller since it's not being scaled.
> On a circle drawn on the XY plane, X is proportional to cos(a) and Y is
> proportional to sin(a) so you can derive the angle by asin(a), then get
> the X (or major radius in this case) by cos(asin(a)).
> 
> If you do want the same as you had but a hemispherical version try
> 
> #declare a = .1 #while(a < 1)
>         object{b_ring scale cos(asin(a)) translate y*a }
>         #declare a = a+.1 #end
> 
> Hope this helps.
> Cheers, PoD.

Pod-

many thanks for your help with the routine.....after a little fiddling
with what you had suggested I came up with a with a real nice screen for
my povray bong.
after I had posted the query to the newsgroup I felt adventurous and
tried to formulate my own routine for creating the hemisphere after
scratching the problem out with pencil and paper and here's what I came
up with...but with strange results.

You can find my improved povray bong in the povray immages group:)

==== Standard POV-Ray Includes ====
#include "colors.inc"	// Standard Color definitions
#include "textures.inc"
#include "metals.inc"

camera
{
  location  <0.0 , 2 ,-5>
  look_at   <0.0 , 0.0 , 0.0>
}

// create a regular point light source
light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-20, 40, -20>
}


// Set a color of the background (sky)
background { White }

   
  


   

#declare m =2;  
   #declare c = 0;
        #while (c < 90)
        #declare m = m*cos(c) 
            torus { m, m/16 translate sin(c)*y pigment { Red } }
         #declare c = c+10;
        #end
    

What am I missing here?

Many thanks in advance.

Best Regards,

Ron Hicks
http://www.geocities.com/SoHo/1006
sig### [at] hotmailcom


Post a reply to this message

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