POV-Ray : Newsgroups : povray.general : Question: Equations in 3-Space Server Time
5 Nov 2024 20:17:42 EST (-0500)
  Question: Equations in 3-Space (Message 1 to 2 of 2)  
From: Michael Bruce
Subject: Question: Equations in 3-Space
Date: 27 Jul 1998 13:56:43
Message: <35BCB12B.E2919581@ic.net>
I've just started messing around with POV Ray, and I have a question
that I'm hoping gets my feet off the ground.  I'm trying to product a
visual graphic of a 3D shape that can be defined using a mathematical
equation.  For example, given any equation that defines a paraboloid in
3-space, how would I generate it along with the X, Y, and Z axes?  I'm
interested in viewing the shape with respect to the coordinate axes, so
it is desired to show the axes as well (with defined tick marks along
the axes).

I trust that this is a straightforward task for more experienced user of

POV, so any help is truly appreciated.  Also, I know there is a news
group dedicated to POV, but unfortunately I've been unsuccessful at
subscribing to it.

Thanks in advance,

Mike Bruce
mpb### [at] icnet


Post a reply to this message

From: Thomas Willhalm
Subject: Re: Question: Equations in 3-Space
Date: 28 Jul 1998 04:02:10
Message: <qqmk94ympal.fsf@goldach.informatik.uni-konstanz.de>
Michael Bruce <mpb### [at] icnet> writes:
> I've just started messing around with POV Ray, and I have a question
> that I'm hoping gets my feet off the ground.  I'm trying to product a
> visual graphic of a 3D shape that can be defined using a mathematical
> equation.  For example, given any equation that defines a paraboloid in
> 3-space, how would I generate it along with the X, Y, and Z axes?  I'm
> interested in viewing the shape with respect to the coordinate axes, so
> it is desired to show the axes as well (with defined tick marks along
> the axes).

Since I've used POV-Ray to generated some nice 3D pictures of mathematical
objects I may help you. 

For your object I suggest to use a quadric, cubic, quartic or poly. They
are described in section 7.5.4.2 and 7.5.4.3 of the POV-Ray docs.
Probably, you will have to mess around with your equations so that your
object can be described by a POV-Ray primitive. If this is not applicable
I suggest to approximate the object by (smoothed) triangles or 
bezier patches. This can be done by an external program or within POV-Ray.
For the latter use #declare and #while to make a loop. Also remark that
there are a lot of functions described in section 7.1.8.1 that you can
use in POV-Ray. 
Instead of an approximation you can also get a modified version of POV-Ray
that enables you to use a lot more functions than polygons for the
definition of your object. It can be downloaded from
http://www.public.usit.net/rsuzuki/e/povray/iso/index.html
But all this won't be necessary if you're content with a paraboloid.

Besides from the mathematical object you're interested in drawing the
coordinate axes. Since a line is infinitely small it can't be drawn with
POV-Ray. Use a cylinder instead! The arrow can be modelled by a cone
at the end. Until now I haven't drawn any tick marks. Probably something
like this will do it (untested!):

union {
  cylinder { -100*x, 100*x, 1 } // axis
  #declare pos = -100
  #while (pos<100)
    cylinder { (pos-0.5)*x, (pos+0.5)*x, 2 } // tick mark
    #declare pos = pos + 10
  #end
  cone { 100*x, 104*x, 2 } // arrow head
  pigment { color rgb 0 }
}

Replace x by y and z for the other axes. Since I never rendered the code
you will probably have to adjust the sizes.
If you want the axes to shine through your object make it semi-transparent 
by using the pigment { color rgbt <1,1,1,0.5>} for the object itself.

> Also, I know there is a news
> group dedicated to POV, but unfortunately I've been unsuccessful at
> subscribing to it.

??

Thomas 

-- 
Tho### [at] uni-konstanzde
http://www.informatik.uni-konstanz.de/~willhalm/
Tschieses lavs ju
An den BND: Eisbombe Fremdenfuehrer Siegfried Heilsarmee


Post a reply to this message

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