POV-Ray : Newsgroups : povray.text.scene-files : Cubic splines - test file : Cubic splines - test file Server Time
5 Jul 2024 10:22:23 EDT (-0400)
  Cubic splines - test file  
From: Nikodemus Siivola
Date: 19 May 2001 09:28:49
Message: <3b067511@news.povray.org>
// see images in p.b.i and question in p.a-u.

#version 3.1;

global_settings
{
 assumed_gamma 1.0
}

camera
{
 location  <0, 1, -4>
 look_at   <0, 0, 0>
}

light_source
{
 <100, 100, -500>
 rgb 1
}

#include "spline_tools.inc"

#declare Test_spline = Make_spline
( 
 "cubic_spline",
 array[5]
 {
  <-2,-1,0>
  <-1,0,0>
  <0,1,0>
  <1,0,0>
  <2,-1,0>
 }
)

#declare Pts = Sample_spline (200, Test_spline)

#macro Dots (R, v_array)
 #local d = dimension_size (v_array, 1);
 #local point = sphere { 0, R }
 #local i = 0;
 #while (i < d)
    object { point translate v_array[i] } 
    #declare i = i + 1;
 #end
#end // Dots  

union
{
 Dots (0.05, Pts)
 pigment { color rgb x }
}

union
{
 Dots (0.075, Test_spline)
 pigment { color rgb y }
}


Post a reply to this message

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