POV-Ray : Newsgroups : povray.advanced-users : Bezier spline deformation : Re: Bezier spline deformation Server Time
29 Mar 2024 06:32:18 EDT (-0400)
  Re: Bezier spline deformation  
From: ingo
Date: 15 Mar 2023 03:15:00
Message: <web.64116ff1122e7e3a17bac71e8ffb8ce3@news.povray.org>
Using my curves macro:
---%<---%<---%<---
#version 3.7;

#include "curve.inc"  //https://ingoogni.nl/download/Curve.zip

#global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 emission 0}}

#declare vT = array[2]{0, 1}

#declare vC = array[13]{
   <1.500000, 0.000000, 0>,
   <1.500000, 0.450694, 0>,
   <0.450694, 1.000000, 0>,
   <0.000000, 1.000000, 0>,
   <-0.450694, 1.000000, 0>,
   <-1.500000, 0.450694, 0>,
   <-1.500000, 0.000000, 0>,
   <-1.500000, -0.450694, 0>,
   <-0.450694, -1.000000, 0>,
   <0.000000, -1.000000, 0>,
   <0.450694, -1.000000, 0>,
   <1.500000, -0.450694, 0>,
   <1.500000, 0.000000, 0>
}
#declare Test = CIt(CIlinear(vT), CIbezier3(vC));


//get the points on the curve
#for(T, 0, 1, 0.005)
  sphere{CITget(Test, T), 0.02 pigment{rgb 1}}
#end

//control points
sphere{Test[1][1][0] 0.03 pigment{rgb <1,0,0>}}
#for(i, 1, dimension_size(Test[1][1],1) - 1)
  sphere{Test[1][1][i] 0.03 pigment{rgb <1,0,0>}}
  cylinder{Test[1][1][i-1], Test[1][1][i], 0.01 pigment{rgb <1,0,0>}}
#end

camera {
  perspective angle 45
  location  <0, 0, -6>
  right     x*image_width/image_height
  look_at   <0, 0, 0.0>
}

light_source{<0, 0,-3000> color rgb 1}

---%<---%<---%<---


Post a reply to this message

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