POV-Ray : Newsgroups : povray.programming : Making Torus : Re: Making Torus Server Time
20 Sep 2021 06:51:25 EDT (-0400)
  Re: Making Torus  
From: clipka
Date: 12 Sep 2014 09:02:02
Message: <5412eeca$1@news.povray.org>
Am 12.09.2014 06:45, schrieb bakom:
> clipka <ano### [at] anonymousorg> wrote:
>> Am 28.08.2014 04:49, schrieb bakom:
>>> I am working on a converter that converts the BRL-CAD's objects in our POV-ray
>>> format. I am able to convert sphere object of BRL-CAD into POV-ray's.
>>> Now, in torus
>>> BRL-CAD make a torus by using
>>> center point, normal vector, inner radius and outer radius.
>>> eg. Center : X Y Z
>>> Normal Vector: X Y Z
>>> Radius1: r1
>>> Radius2: r2
>>> I am able to convert it( by avoiding normal of brlcad's object ) but as in
>>> BRL-CAD, using normal to torus we can align/rotate torus, is there any way to
>>> make torus using normal in POV-ray? There is a rotation macro used to rotate it
>>> but I want to use normal vector as it is.
>>
>> Nope, you need to apply a rotation.
>
> Ok, but in torus.cpp file
> https://github.com/POV-Ray/povray/blob/master/source/backend/shape/torus.cpp
> there is a normal vector calculation at line number 358. So can we use it in any
> way for making torus?

No; the "normal vector calculation" in there computes the "surface 
normal" for a given point, not the normal vector of the plane on which 
the torus lies.

> If plane is formed by using normal so why not torus in POV-ray?(general
> question).

The mathematical formula for computing the intersection of a ray with a 
torus is complicated enough as it is, so this is simply how the torus 
object is implemented.

Theoretically it would be possible to allow for a vector to be 
specified, and automatically convert that into a corresponding rotation 
matrix; however, that would have to be done in the parser, which is ugly 
and kludgy enough already, so we try to avoid changes in there.


Post a reply to this message

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