POV-Ray : Newsgroups : povray.beta-test : Twisted sp(l)ine : Twisted sp(l)ine Server Time
30 Jul 2024 22:25:13 EDT (-0400)
  Twisted sp(l)ine  
From: David Wallace
Date: 26 Sep 2001 19:04:20
Message: <3BB25EFE.719F8B0E@earthlink.net>
I hope this is just a user screw-up, but I think it bears mentioning.
The spline calculations could well have some arcane bug.  Consider the
test code below:

light_source { < 24,7700, -515> color rgb 1 }

camera { location < -745, 87.0 ,  284> look_at < -400,  8.6 ,  0.0> }
// 4. Medium object snapshot

#declare spHull = spline {
 cubic_spline
 -0.03078, < 540, -10>
  0.0000 , < 546,   0>
  0.03078, < 540,  10>
  0.13960, < 500,  20>
  0.34574, < 440,  70>
  0.61716, < 340,  94>
  1.51453, <   0,  95>
  2.62304, <-420,  94>
  2.84308, <-500,  70>
  2.99278, <-540,  30>
  3.05180, <-520,  20>
  3.11081, <-540,  10>
  3.14159, <-546,   0>
  3.17237, <-540, -10>
  3.23139, <-520, -20>
  3.29041, <-540, -30>
  3.43971, <-500, -70>
  3.66015, <-420, -94>
  4.76866, <   0, -95>
  5.66602, < 340, -94>
  5.93745, < 440, -70>
  6.14358, < 500, -20>
  6.25241, < 540, -10>
  6.28319, < 546,   0>
  6.31396, < 540,  10>
}

#declare spHull2 = spline {
 cubic_spline
 -0.12303, < 488, -66>
  0.00000, < 525,   0>
  0.12303, < 488,  66>
  0.27318, < 400,  94>
  0.92358, <   0,  95>
  1.57397, <-400,  94>
  3.01856, <-488,  66>
  3.14159, <-525,   0>
  3.26462, <-488, -66>
  4.70921, <-400, -94>
  5.35961, <   0, -95>
  6.01000, < 400, -94>
  6.16016, < 488, -66>
  6.28319, < 525,   0>
  6.40621, < 488,  66>
}

#declare ip = 0;

#while (ip<2*pi)
 sphere { spHull(ip), 1 pigment { rgb <1, 1, 0> } }
 #declare ip = ip + .01;
#end

The code (as written) draws the outline of a shape similar to a Pac-Man
ghost, which is what I want.  The second spline, spHull2, is supposed to
draw something akin to an oval, but it draws weird curlicues near the
middle (where the parameter is pi).  I've been racking my brain trying
to find the error in my spline which causes this with no success.  So...
can you untwist the knot in my spline via the code, or is the spline
calculation in POV-Ray flawed?

POV-Ray 3.5b4, K6-II 400, 128MB, Win98SE


Post a reply to this message

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