POV-Ray : Newsgroups : povray.general : Spline animation question... Server Time
2 Nov 2024 17:17:37 EDT (-0400)
  Spline animation question... (Message 1 to 5 of 5)  
From: Carl Hoff
Subject: Spline animation question...
Date: 19 Feb 2004 09:49:03
Message: <4034ccdf@news.povray.org>
To see what prompted this post see my thread called "Light Cycle animation
questions..." over in the newusers area.

I'm trying to make an animation that copies the effect of the "3D Pipes"
screen saver.  Say for example I define this path:

spline {
  linear_spline
  5,
  0.0, <0,0,0>
  0.1, <0,0,1>
  0.3, <2,0,1>
  0.6, <2,3,1>
  1.0, <2,3,5>
}

I want to draw a sphere_sweep over a percentage of this spline that varies
with the clock value.  What's the best general way to do that?  I'd like to
be able to define other paths and be able to use the same macro.

After that problem is solved I'd like to be able to put a vehicle in front
of the spline that appears to be leaving it as a trail.  I know how to
define 'forward' along the spline but how do I define 'up' so that I know
how to orientate my vehicle.

I hope I've defined my problems clearly,
Carl


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Spline animation question...
Date: 19 Feb 2004 21:12:46
Message: <40356d1e@news.povray.org>
Mike Williams has a file to do this with meshes at p.b.s.-f.
(With the web interface down, I'm sorry that I can't find it for you
directly)


Post a reply to this message

From: Carl Hoff
Subject: Re: Spline animation question...
Date: 20 Feb 2004 09:41:24
Message: <40361c94@news.povray.org>
Thanks... I can't pull up the web interface either.  Anyone know how long
its going to be down?  Which problem does his file address?  The extruding
spline problem, the orientation problem, or both?  If things are going to be
down a while is it acceptable to ask for Mike Williams email address?

"Greg M. Johnson" <gregj;-)565### [at] aolcom> wrote in message
news:40356d1e@news.povray.org...
> Mike Williams has a file to do this with meshes at p.b.s.-f.
> (With the web interface down, I'm sorry that I can't find it for you
> directly)
>
>


Post a reply to this message

From: Carl Hoff
Subject: Re: Spline animation question...
Date: 22 Feb 2004 00:52:18
Message: <40384392@news.povray.org>
Ok... I've found a solution to both of my problems.  I've posted code that
does what I want it to over in povray.binaries.scene-files.  Please feel
free to take a look.  Two other problems that I came across in this
situation were:

(1) The same issue bongotastic had with splines of variable length.  In my
code if I change the number of points in my spline I have to change
path1_num, the array path1, and edit my path1_spline declaration.  It really
seems I should be able to do this in a general way and not have to change
the path1_spline declaration but I couldn't find a way to do it.

(2) It proved to be harder then I thought to position an object that's
defined with forward in the x-direction and up in the y-direction to a new
set of forward and up vectors.  I got something that works but I think I did
it in a very ugly way.  Surely there is a more general way of doing this.

Anyways please feel to play with the code I posted and I welcome any
constructive feedback anyone wants to share.

Thanks,
Carl


Post a reply to this message

From: Carl Hoff
Subject: Re: Spline animation question...
Date: 22 Feb 2004 09:17:17
Message: <4038b9ed@news.povray.org>
> (1) The same issue bongotastic had with splines of variable length.
> In my code if I change the number of points in my spline I have to
> change path1_num, the array path1, and edit my path1_spline
> declaration.  It really seems I should be able to do this in a general
> way and not have to change the path1_spline declaration but I
> couldn't find a way to do it.

This problem is fixed with the help of bongotastic's thread in
povray.newusers.

#declare path1_spline = spline {
  linear_spline
  #declare ctr = 0;
  #while (ctr < path1_num - 0.5)
    path1_seg_time[ctr], path1[ctr][0],
    #declare ctr = ctr + 1;
  #end
}

> (2) It proved to be harder then I thought to position an object that's
> defined with forward in the x-direction and up in the y-direction to a
> new set of forward and up vectors.  I got something that works but
> I think I did it in a very ugly way.  Surely there is a more general
> way of doing this.

Still thinking about this one.

Carl


Post a reply to this message

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