POV-Ray : Newsgroups : povray.newusers : Length of spline object changes during animation : Length of spline object changes during animation Server Time
26 Apr 2024 13:50:39 EDT (-0400)
  Length of spline object changes during animation  
From: Aj
Date: 17 Aug 2022 10:40:00
Message: <web.62fcfd388783b6f6cb63c1d33d902b29@news.povray.org>
Hello everyone,

I am pretty new to povray and I have the following code, where I get the x,y,
and z coordinates of 6 different points from a simulation and then create a
sphere sweep through these points. But the problem is the length of this object
changes with time i.e. as the points move, the sphere sweep object appears to
change size. If you look at the picture attached then the white and green
objects appear to be of different lengths.

Any suggestion will be really helpful.

Here is my code:

"""
#include"colors.inc"
 camera {
  location <0,0,-1000>
  look_at <0,0,0>
   angle 22
  }
light_source { <100,100,-100>  color rgb<1,1,1> }
background {color rgb<0.0,0.0,0.0> }
#declare Scale = 3.11*< 4200,210,50 >;
#declare Radius = 10.9;
#declare P01 = Scale*<0,0,-14.2857>;
#declare P02 = Scale*<0,0,0.2>;
#declare P03 = Scale*<0,0,0.4>;
#declare P04 = Scale*<0,0,0.6>;
#declare P05 = Scale*<0,0,0.8>;
#declare P06 = Scale*<0,0,1>;
#declare Thing = union{




  sphere_sweep {
  b_spline
  6,
   P01,Radius,
   P02,Radius,
   P03,Radius,
   P04,Radius,
   P05,Radius,
   P06,Radius
  tolerance 0.1
  texture{ pigment{ color rgb<0.69,0.99,0.15>}
  finish { phong 1
   ambient 0.3
 }
 }


 }
rotate<-90,0,0>
}
 #declare Thing_max = max_extent(Thing);
 #declare Thing_min = min_extent(Thing);
 #declare Thing_centre = (max_extent(Thing) + min_extent(Thing))/2;
sphere{Thing_centre, 1.5 pigment{rgb<1,0,0>} rotate<0,360*clock,0>}


object{Thing rotate<0,360*clock,0>}



#declare Scale =  3.11*< 4200,210,2>;

#declare P001 = 3.11*< 4200,210,50>*<0,0,-20.2857>;
#declare P002 = Scale*<8.6101e-11,-9.0312e-10,0.2>;
#declare P003 = Scale*<0.0025215,-0.030611,0.39763>;
#declare P004 = Scale*<0.0025633,-0.079185,0.59164>;
#declare P005 = Scale*<-0.0050769,-0.14013,0.78198>;
#declare P006 = Scale*<-0.012717,-0.20107,0.97231>;
#declare Thing2 = sphere_sweep {




  b_spline
  6,
   P001,Radius,
   P002,Radius,
   P003,Radius,
   P004,Radius,
   P005,Radius,
   P006,Radius
  tolerance 0.1
  texture{ pigment{ color rgb<1,1,1>}
  finish { phong 1
   ambient 0.3
 }
 }


 }
object{Thing2 rotate<-90,0,0> translate <0,-3,0>}

"""


I have been trying to do something like shown in this video:

https://www.cosseratrods.org/videos/RALvideos/Case2-front_view_web.mp4


Post a reply to this message


Attachments:
Download 'pyel1.png' (15 KB)

Preview of image 'pyel1.png'
pyel1.png


 

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