POV-Ray : Newsgroups : povray.programming : Implementing new objects : Implementing new objects Server Time
30 Jun 2024 12:07:08 EDT (-0400)
  Implementing new objects  
From: Helix
Date: 21 May 2004 19:45:00
Message: <web.40ae93a4f8131bc2a5c747920@news.povray.org>
Tanglecube quartic equation:
x^4 - 5*x^2 + y^4 - 5*y^2 + z^4 - 5*z^2 + 11.8 = 0

We inject the ray's parametric equation (P + D * depth) inside it.

Polynomial: a*x^4 + b*x^3 + c*x^2 + d*x + e

Coefficients are:
a = Dx^4 + Dy^4 + Dz^4
b = 4.0 * (Px*Dx^3 + Py*Dy^3 + Pz*Dz^3)
c = 6.0 * (Px^2*Dx^2 + Py^2*Dy^2 + Pz^2*Dz^2) - 5.0 * (Dx^2 + Dy^2 + Dz^2)
d = 4.0 * (Px^3*Dx + Py^3*Dy + Pz^3*Dz) - 10.0 * (Px*Dx + Py*Dy + Pz*Dz)
e = Px^4 + Py^4 + Pz^4 - 5.0 * (Px^2 + Py^2 + Pz^2) + 11.8

The normal is:
N[X] = 4*x^3 - 10*x
N[Y] = 4*y^3 - 10*y
N[Z] = 4*z^3 - 10*z

The scene result isn't right, so I'm asking myself if my formulas'
coefficients
are correct or not...


Post a reply to this message

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