home *** CD-ROM | disk | FTP | other *** search
- // Algebraic surfaces for Rayce
- // formulas based on Xander Enzmanns shapesq.inc
-
- // I hope the pov team doesn't mind, after all could there be a
- // copyright on formulas?
-
- /*
- specifically, povlegal states:
-
- The user is also granted the right to use the scenes files and include
- files distributed in the INCLUDE and DEMO sub-directories of the POVDOC
- archive when creating their own scenes. Such permission does not extend to
- */
-
-
-
- /* Here is a quick do of a klein-bottle. It is generated with the poly
- command in PoV 2.0. Be careful, it does not have a
- clearly defined inside :). The formula is:
-
- by
- T. Nordstrand tore@maxwell.fi.uib.no or nfytn@alf.uib.gno
- */
-
- /* Looks like a mushroom according to me, and doesn't look like the
- klein bottles I've seen. [HWN]
- */
-
- #declare Klein_Bottle = algebraic {
- $ (x^2+y^2+z^2+2*y-1)*((x^2+y^2+z^2-2*y-1)^2-8*z^2)+
- 16*z*(x^2+y^2+z^2-2*y-1) $
- }
-
- /*
- */
- #declare Bicorn = algebraic {
- $ y^2 - (x^2 + z^2) * y^2 - (x^2 + z^2 + 2 *y - 1)^2 $
- }
-
- #declare Crossed_Trough = algebraic { $ y = x^2* z^2 $ }
-
- /* Looks like a drop falling up. (To the left, in the standard camera
- model.) */
- #declare Cubic_Cylinder = algebraic {
- $ y^2 + z^2 = 0.5*(x^3 + x^2) $
- }
-
- /*
- Haven't figured out this weird form, but it seems to render correctly.
- [HWN]
- */
- #declare Cubic_Saddle = algebraic {
- $ z = x^3 - y^3 $
- }
-
- /*
- two opposite cones joined by two small tubes.
- */
- #declare Devils_Curve = algebraic {
- $ x^4 + 2 * x^2 * z^2 - 0.36 * x^2 - y^4 + 0.25 * y^2 + z^4 $
- }
-
- /*
- Hmm.. not quite.
- */
- #declare Folium = algebraic {
- $ 2 * x^2 - 3 * x * y^2 - 3* x *z^2 + y^2 + z^2 $
- }
-
-
- /* sort of tear drop.
- */
- #declare Glob_5 = algebraic {
- $ y^2 + z^2 = 0.5 * x^5 + 0.5* x^4 $
- }
-
- /*
- a helix, not yet tested with new clipshapes.
- */
-
- #declare Helix = object{
- algebraic { $ - 0.16667 * x * z^3 + x * z + 0.5 * y * z^2 - y $ }
-
- clipped_by {
- plane { <-1,0,0>, 1.4142 }
- plane { <1,0,0>, 1.4142}
- }
- }
-
- /*
- Bluhh.
- */
- #declare Hyperbolic_Torus = algebraic {
- $ x^4 + 2* x^2* y^2 - 2* x^2* z^2 - 104 *x^2 + y^4 - 2 *y^2* z^2 +
- 56* y^2 + z^4 + 104* z^2 + 784 $
- }
-
- // Lemniscate of Gerono. (ok)
- // sort of hourglass.
- #declare Gerono_Lemniscate = algebraic {
- $ x^4 - x^2 + y^2 + z^2 $ closed
- }
-
- /*
- I don't know what it's supposed to be, but it suffers from huge
- numerical inaccuracies. I'm feeling consolated by the fact the PoV
- messes up too.
-
- :
-
- after having fixed bug...
- Hah! Rayce renders it correctly, without sturm sequences!
- */
- #declare Monkey_Saddle= algebraic {
- $ z = (x^3 - 3 * x * y^2) $
- }
-
- /*
- not yet.
- */
- #declare Parabolic_Torus = algebraic {
- $ x^4 + 2* x^2* y^2 - 2 *x^2 *z - 104 *x^2 + y^4 - 2* y^2* z +
- 56 *y^2 + z^2 + 104 *z + 784 $
- }
-
- // A sort of drop that needs a diet :)
- // The demo in PoV gave dirty shit.
- #declare Piriform = algebraic {
- $ (x^4 - x^3) + y^2 + z^2 $ closed
- }
-
- #declare Roll_Mill4 =algebraic {
- $ x^4 - 6* x^2* y^2 + 6* y^4 = 1$
- }
-
- /*
- a cube with rounded corners.
- element of a class of shapes described by
-
- || X ||_p = 1 (p >= 1) X in R^n
-
- || . ||_p is the p-norm defined by
-
- (|x_1|^p + |x_2|^p + ... + |x_n|^p)^(1/p) = 1
-
- In this case (n = 3 so we get 3-d real space )
-
- (|x|^p + |y|^p + |z|^p)^(1/p) = 1
-
- since 1^p = 1, this is equivalent to
-
- |x|^p + |y|^p + |z|^p = 1
-
-
- if p-> inf. then this forms a cube, faces parallel to the axes
-
- if p = 1, it's a cube with corners in <0,0,1>, <1,0,0>, <-1,0,0>
- etc.
-
- if p = 2, it's a sphere. This is the shape for p = 4.
-
- */
-
- #declare Hyper_Quadric4 = algebraic {
- $ x^4 + y^4 + z^4 = 1 $ closed
- }
-
- /*
- The original reason behind Art (Vort's raytracer)
- */
- #declare Hunt_Surface = algebraic {
- $ 4 * (x^2 + y^2 + z^2 - 13)^3 + 27* (3*x^2 + y^2 -4*z^2 - 12)^2 $
- }
-