POV-Ray : Newsgroups : povray.general : sphere and torus syntax Server Time
6 Nov 2024 18:27:13 EST (-0500)
  sphere and torus syntax (Message 1 to 8 of 8)  
From: IMBJR
Subject: sphere and torus syntax
Date: 14 Apr 2004 14:28:22
Message: <407d82c6$1@news.povray.org>
Just wondering why we cannot state in the definition of a torus it's
"centre" as we do for a sphere?

Is this because the torus does not have a centre as such, but it does have
an origin.


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: sphere and torus syntax
Date: 14 Apr 2004 15:32:51
Message: <407d91e3$1@news.povray.org>
> Just wondering why we cannot state in the definition of a torus it's
> "centre" as we do for a sphere?
>
> Is this because the torus does not have a centre as such, but it does have
> an origin.

The major building parts for a torus are just the major and minor radius. A
box, for example, also has an origin, but you still just position the two
corners. I guess for the sphere, the center position just can easily be
integrated into the solving process, whereas for a torus it would be a
matrix-transformation anway, but that's just an educated guess and may be
incorrect.

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Daniel Patrick Johnson
Subject: Re: sphere and torus syntax
Date: 16 Apr 2004 07:38:31
Message: <407fc5b7$1@news.povray.org>
IMBJR wrote:
> Just wondering why we cannot state in the definition of a torus it's
> "centre" as we do for a sphere?
> 
> Is this because the torus does not have a centre as such, but it does have
> an origin.
> 
> 

You could always write a macro to do that for you.  Or you could 
translate it to where you want in the definition.


Post a reply to this message

From: Sally
Subject: Re: sphere and torus syntax
Date: 17 Apr 2004 17:40:53
Message: <4081a465$1@news.povray.org>
My guess is that a torus requires more parameters anyways compared to a
sphere, so to keep it simple they left out the specifying of an origin
and you use a translate later instead if you need to.


Post a reply to this message

From: Severi Salminen
Subject: Re: sphere and torus syntax
Date: 18 Apr 2004 07:06:39
Message: <4082613f$1@news.povray.org>
IMBJR wrote:
> Just wondering why we cannot state in the definition of a torus it's
> "centre" as we do for a sphere?
> 
> Is this because the torus does not have a centre as such, but it does have
> an origin.

I guess it is only because of it has been allways that way. I see no 
clever reason why there is not/should be the center parameter. It also 
_might_ have to do with the fact that the orientation of a torus is 
predefined. If one wanted to rotate torus, it allways has to be first in 
the origin.

Severi


Post a reply to this message

From: Warp
Subject: Re: sphere and torus syntax
Date: 18 Apr 2004 10:20:36
Message: <40828eb4@news.povray.org>
Severi Salminen <sev### [at] not_thissibafi> wrote:
> I see no clever reason why there is not/should be the center parameter.

  I do.

  AFAIK all primitives are created with no transformation matrix by
default. The transformation matrix only slows down the raytracing if
it's unneeded and thus it's not created by default to any primitive.
For instance, a sphere with a center (located anywhere) and a radius
can be raytraced without a transformation matrix.
  Even when you transform a primitive POV-Ray will try to avoid
creating a transformation matrix if it can. For example, if you
translate or scale uniformly a sphere (and probably even when
you rotate it) it will not create a transformation matrix for it
but only modify its center and radius.

  A torus is a quartic. I don't remember if you can specify a location
offset for the torus quartic, but whether or not you can, the torus
implementation was probably designed to be as fast as possible by
not introducing more complexity to the quartic. Thus any transformation
you apply to the torus (even a translate) will generate a transformation
matrix for it. This means that if the torus syntax would have a center
parameter, a transformation matrix would always be created for it.
  Granted, this would probably not matter anything, but the torus
probably just follows the same principle as all the other primitives:
No transformation matrix by default.

  (And no, I haven't checked if it's true that no primitives get a
transformation matrix by default, so I may be wrong here. :) )

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: IMBJR
Subject: Re: sphere and torus syntax
Date: 18 Apr 2004 15:27:49
Message: <iul5801r94q455sph8illpec1u35s5bo0m@4ax.com>
On 18 Apr 2004 10:20:36 -0400, Warp <war### [at] tagpovrayorg> wrote:

>Severi Salminen <sev### [at] not_thissibafi> wrote:
>> I see no clever reason why there is not/should be the center parameter.
>
>  I do.
>
>  AFAIK all primitives are created with no transformation matrix by
>default. The transformation matrix only slows down the raytracing if
>it's unneeded and thus it's not created by default to any primitive.
>For instance, a sphere with a center (located anywhere) and a radius
>can be raytraced without a transformation matrix.
>  Even when you transform a primitive POV-Ray will try to avoid
>creating a transformation matrix if it can. For example, if you
>translate or scale uniformly a sphere (and probably even when
>you rotate it) it will not create a transformation matrix for it
>but only modify its center and radius.
>
>  A torus is a quartic. I don't remember if you can specify a location
>offset for the torus quartic, but whether or not you can, the torus
>implementation was probably designed to be as fast as possible by
>not introducing more complexity to the quartic. Thus any transformation
>you apply to the torus (even a translate) will generate a transformation
>matrix for it. This means that if the torus syntax would have a center
>parameter, a transformation matrix would always be created for it.
>  Granted, this would probably not matter anything, but the torus
>probably just follows the same principle as all the other primitives:
>No transformation matrix by default.
>
>  (And no, I haven't checked if it's true that no primitives get a
>transformation matrix by default, so I may be wrong here. :) )

There's something about this that certainly sounds right.

--------------------------------
My First Subgenius Picture Book:
http://www.imbjr.com


Post a reply to this message

From: Christopher James Huff
Subject: Re: sphere and torus syntax
Date: 19 Apr 2004 06:55:14
Message: <cjameshuff-B483C0.06561919042004@news.povray.org>
In article <40828eb4@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   (And no, I haven't checked if it's true that no primitives get a
> transformation matrix by default, so I may be wrong here. :) )

Cones and cylinders do. It's easier to solve for a cone or cylinder 
aligned along an axis, and rotate/translate it into position.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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