POV-Ray : Newsgroups : povray.newusers : Light Cycle animation questions... Server Time
30 Jul 2024 16:19:08 EDT (-0400)
  Light Cycle animation questions... (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: Carl Hoff
Subject: Light Cycle animation questions...
Date: 16 Feb 2004 10:34:15
Message: <4030e2f7@news.povray.org>
I'm now playing with the animation features built into POV-Ray and I wanted
to share the idea of what I'm trying to do.  I'm sure this basic idea has
been done by others and shouldn't be too hard to do but I'm not seeing an
easy solution at the moment.  So here are a few questions:

(1)  In the movie TRON the effect of the rotation of the wheels of the Light
Cycle was achieved by putting a spoke in the wheel that was present in one
frame and gone in the next.  Since the values that 'clock' takes on is
dependant on the number of frames what is the best way to do this as I might
want to play with the number of frames I generate for a given scene.  I'm
also thinking about having blinking lights that follow some pattern.
Something like on for 2 frames, off for 1, back on for 2, then off for 10
before repeating. At the moment I'm not sure how to pull off these effects.

(2)  The light trail...  Lets say I have a game grid that's 100 units by 100
units.  I want to be able to set a path for my bike to follow.  Something
like:

<50,0>, <50,50>, <75,50>, <75,75>, <25,75>....

I think I can move the bike by itself easy enough but I'm but sure about the
best way to draw the light trail.  It should have a rectangular
cross-section and I'm thinking about the idea of generating the whole shape
for the path with a prism then putting a 'clock' dependant texture on it
that's totally invisible in front of the bike position and visible behind
it.  It'd also need a texture map to put a vertical white line on the trail
for something like every 5 units of its length.  Any tips on how best to do
that?

I'm still very green when it comes to POV-Ray and my programming is a little
rusty but its getting better.  I'm sure I'll solve the above two problems on
my own eventually but I think I'm making this problem harder then it is and
I think the easy solution is eluding me. I'm open to any tips you guys can
share or any small pieces of code that I could play with and learn something
from.  With some help I might be able to make some cool light cycle
animations soon.

Thank you so much for your time,
Carl


Post a reply to this message

From: Hughes, B 
Subject: Re: Light Cycle animation questions...
Date: 16 Feb 2004 12:45:38
Message: <403101c2$1@news.povray.org>
"Carl Hoff" <hof### [at] wtnet> wrote in message news:4030e2f7@news.povray.org...
>
> (1) --- also thinking about having blinking lights that follow some
pattern.
> Something like on for 2 frames, off for 1, back on for 2, then off for 10
> before repeating.
>
> (2)  The light trail...  Lets say I have a game grid that's 100 units by
100
> units.  I want to be able to set a path for my bike to follow.  Something
> like:
>
> <50,0>, <50,50>, <75,50>, <75,75>, <25,75>....
>
> I think I can move the bike by itself easy enough but I'm but sure about
the
> best way to draw the light trail.  It should have a rectangular
> cross-section and I'm thinking about the idea of generating the whole
shape
> for the path with a prism then putting a 'clock' dependant texture on it
> that's totally invisible in front of the bike position and visible behind
> it.  It'd also need a texture map to put a vertical white line on the
trail
> for something like every 5 units of its length.  Any tips on how best to
do
> that?

In answer to question 1... I'd say have a look at the Clock Modifier macro
by Chris Colefax, if you haven't already. It's at:
http://www.geocities.com/SiliconValley/Lakes/1434/index.html
Can create repeat events in various ways, and using
'frame_number/final_frame' as a parameter should work.

For question 2... use a clocked linear 'spline' path for the bike, and
perhaps apply the trail line in the same way (with a object for the line).
I'm not sure about the prism idea. It would certainly need to be done in
such a way which doesn't have the texture intersecting with other points. If
you use a single already-completed object, that could be a problem. Best
thing might be an object which forms as it moves along, and a 'sphere_sweep'
might be good for that. Just need the values given to it to change with
time.

-- 
Bob H.
http://www.3digitaleyes.com


Post a reply to this message

From: Carl Hoff
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 00:20:22
Message: <4031a496@news.povray.org>
> In answer to question 1... I'd say have a look at the Clock Modifier
> macro by Chris Colefax, if you haven't already. It's at:
> http://www.geocities.com/SiliconValley/Lakes/1434/index.html
> Can create repeat events in various ways, and using
> 'frame_number/final_frame' as a parameter should work.

Thanks... I've just downloaded it.  I'll take a peak and see what
I can get it to do.

> For question 2... use a clocked linear 'spline' path for the bike,
> and perhaps apply the trail line in the same way (with a object
> for the line). I'm not sure about the prism idea. It would certainly
> need to be done in such a way which doesn't have the texture
> intersecting with other points.

Why?  I just ran this little test...

  #include "colors.inc"
  camera {location  <30,-30,-10> look_at <2,2,2> angle 20}
  light_source {<500, -700, -150> 0.7*White}
  light_source {<150, 1000, -800> 0.6*White}
  light_source {<1000, 100, -200> 0.7*White}
  light_source {<-500, 1000, -1500> 0.5*White}

  box {<1,1,1>, <5,5,5> pigment {Red}}
  sphere {<0,0,0>, 3 pigment {color transmit 1.0}}

and the sphere doesn't seem to cause any negative effects on
the cube.  So I was thinking as long as the tail had this texture
ahead of the bike it'd be ok.  It would just become visible after
the bike at passed over it.

> If you use a single already-completed object, that could be a
> problem. Best thing might be an object which forms as it moves
> along, and a 'sphere_sweep' might be good for that. Just need
> the values given to it to change with time.

Having the object form as it moves might be as easy as having
a texture that changes as it moves.  I like the sphere_sweep
idea but the trail isn't a series of cones and its a little more then
just changing the values passed to the sphere_sweep.  You'd
also have to be able to change the number of values.  Only the
last one is moving. Given a few days I'm sure I'll figure something
out but I'm not sure it'll be the most efficient solution.

Thanks,
Carl


Post a reply to this message

From: Hughes, B 
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 12:22:46
Message: <40324de6$1@news.povray.org>
"Carl Hoff" <hof### [at] wtnet> wrote in message news:4031a496@news.povray.org...
>
> > For question 2... use a clocked linear 'spline' path for the bike,
> > and perhaps apply the trail line in the same way (with a object
> > for the line). I'm not sure about the prism idea. It would certainly
> > need to be done in such a way which doesn't have the texture
> > intersecting with other points.
>
> Why?  I just ran this little test...
>
>   #include "colors.inc"
>   camera {location  <30,-30,-10> look_at <2,2,2> angle 20}
>   light_source {<500, -700, -150> 0.7*White}
>   light_source {<150, 1000, -800> 0.6*White}
>   light_source {<1000, 100, -200> 0.7*White}
>   light_source {<-500, 1000, -1500> 0.5*White}
>
>   box {<1,1,1>, <5,5,5> pigment {Red}}
>   sphere {<0,0,0>, 3 pigment {color transmit 1.0}}
>
> and the sphere doesn't seem to cause any negative effects on
> the cube.  So I was thinking as long as the trail had this texture
> ahead of the bike it'd be ok.  It would just become visible after
> the bike at passed over it.

I'm not exactly sure what you are saying with that bit of script but what I
was trying to warn of has to do with how a texture pattern will interact
with corners/turns as it moves along the path line.

It might be easier to show an example of what I'm thinking about rather than
just describe it, so I've posted a sample script at povray.text.scene-files
which will animate.

I think the idea must be to prevent interaction with a perpendicular section
of the path. Probably solvable, but I haven't gone into that.

Bob H.


Post a reply to this message

From: Carl Hoff
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 12:58:39
Message: <4032564f$1@news.povray.org>
> I'm not exactly sure what you are saying with that bit of script

I'm thinking I misunderstood you.  I took what you said to imply
I'd have a problem with the light trail if it already existed even
though it had no texture because it would be intersecting my bike.
So my test was to see what a textureless sphere would do to the
box.  Think of the sphere as a simple trail and the box as my bike.

> but what I was trying to warn of has to do with how a texture
> pattern will interact with corners/turns as it moves along the path
> line.
>
> It might be easier to show an example of what I'm thinking about
> rather than just describe it, so I've posted a sample script at
> povray.text.scene-files which will animate.
>
> I think the idea must be to prevent interaction with a perpendicular
> section of the path. Probably solvable, but I haven't gone into that.
>
> Bob H.

Thank you so much for the code.  I need to digest the code to see
what you are doing but I like it.

Thanks,
Carl


Post a reply to this message

From: Hughes, B 
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 17:00:30
Message: <40328efe$1@news.povray.org>
Carl Hoff e-mailed this to me:
> Ok... I see what you are doing now I think.  To be honest I want the
> effect to continue around corners a little so I can work with that.  The
> main problem I'm having isn't with the effect at the head of the trail.
> That will be moving with the bike.  Where I'm having the hardest time
> with is simply how to draw the trail.  Its fixed in position and growing.
> I can of course break each line segment into its own little animation
> and deal with it that way but say I wanted to animate your sphere
> sweep having it start with zero length till it covered the whole path at
> the end.  I can animate a sphere moving along a linear_spline but
> at present I'm not sure how to animate a sphere moving along a
> linear_spline leaving the bent cylinder behind it.  The other issue I
> see coming (I'm not to this point yet) but lets say the object I'm
> animating along the linear_spline isn't a sphere but it has a defined
> front and back.  At a given point along the linear spline how do I
> define forward?  And to take this one dimension farther if the cycle
> can drive up walls how do I define up?
And I'm posting it here so I don't get backed into a corner (pun intended)
alone while trying to help him.

Hi Carl.

Well, glad you explained that this is about tacking a trail start down and
stretching it along from there. I wasn't catching onto that idea at all,
before now. I was only thinking of a blur left behind the bike. Looking at
TRON DVD on shelf and it doesn't even show any of that, must see movie
again.

Growing the trail along as the bike moves... guess that could be done...
maybe by giving the sphere_sweep the number of points as 'frame_number'. Or
at least some integer based on it. Then the points could be gathered from an
'array', previously set up, invoking them via a 'while' loop which uses the
point count to pull them out of the array.

Make sense? Gee, I hope somebody else out there knows what we're talking
about and has some ideas too. I never became a wizard at using arrays in
POV. Thinking it over, I'm not so sure it could be done this way.

What you asked about the front/back or leading/trailing sides is simply a
matter of pulling a vector from out of the spline by its time (or t) value.
Such as I did to place the light_source ahead of center. It's just any
amount +/- of the clock, in that example. And then the question about going
up walls would be done by adding y values to the sphere_sweep and spline
vectors.

-- 
Bob H.
http://www.3digitaleyes.com


Post a reply to this message

From: Carl Hoff
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 17:54:00
Message: <40329b88@news.povray.org>
> And I'm posting it here so I don't get backed into a corner
> (pun intended) alone while trying to help him.

Arg!!! Arg!!! Arg!!! I'm so sorry about that.  Darn Outlook
Express has the "Reply Group" button right next to the "Reply"
button. You aren't the first I've made that mistake with.  I didn't
even know I'd done that this time till I saw your reply here.

> Hi Carl.

Hello Bob,

> Well, glad you explained that this is about tacking a trail start
> down and stretching it along from there. I wasn't catching onto
> that idea at all, before now.

I was initially trying to find out what the best way to do that
was.  I.e. stretch the shape or put the shape in place first with
a texture like this "color transmit 1.0" and stretch a visable
texture over it from the start.  At the moment I'm not sure how
to do either though.

> I was only thinking of a blur left behind the bike. Looking at
> TRON DVD on shelf and it doesn't even show any of that,
> must see movie again.

The bike only leaves a permanent trail when its on the game
grid.  With a little digging I'm sure I could find a nice screen
grab from the movie. But here is a picture I've already made
with POV-Ray.  Check it out:

http://www.tron-sector.com/gallery/show.aspx?ID=1037

I can make just about any still image I want and now I'm
trying to to take a stab at animation.

> Growing the trail along as the bike moves... guess that
> could be done... maybe by giving the sphere_sweep the
> number of points as 'frame_number'. Or at least some
> integer based on it. Then the points could be gathered
> from an 'array', previously set up, invoking them via a
> 'while' loop which uses the point count to pull them out
> of the array.
>
> Make sense?

Yes... I think so.  But I'm not sure I can pull that off.

> Gee, I hope somebody else out there knows what we're
> talking about and has some ideas too. I never became a
> wizard at using arrays in POV. Thinking it over, I'm not
> so sure it could be done this way.

Well the simple way is to make once scene file for each
strait segment but I think I can do better then that.  Plus
once I start put in more then one bike it would be nice
to have a macro that I could put 2 or 3 paths into and
sit back and watch the bikes go.

> What you asked about the front/back or leading/trailing
> sides is simply a matter of pulling a vector from out of the
> spline by its time (or t) value. Such as I did to place the
> light_source ahead of center. It's just any amount +/- of
> the clock, in that example. And then the question about
> going up walls would be done by adding y values to the
> sphere_sweep and spline vectors.

Thanks... that sounds simple enough.

Carl


Post a reply to this message

From: Hughes, B 
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 19:37:15
Message: <4032b3bb$1@news.povray.org>
"Carl Hoff" <hof### [at] wtnet> wrote in message news:40329b88@news.povray.org...
> > And I'm posting it here so I don't get backed into a corner
> > (pun intended) alone while trying to help him.
>
> Arg!!! Arg!!! Arg!!! I'm so sorry about that.  Darn Outlook
> Express has the "Reply Group" button right next to the "Reply"

You're not the only one. Maybe we can blame this button-pushing world.

> The bike only leaves a permanent trail when its on the game
> grid.  With a little digging I'm sure I could find a nice screen
> grab from the movie. But here is a picture I've already made
> with POV-Ray.  Check it out:
>
> http://www.tron-sector.com/gallery/show.aspx?ID=1037
>
> I can make just about any still image I want and now I'm
> trying to to take a stab at animation.

You do stills very well. I've seen some of this from you already.

> > Growing the trail along as the bike moves... guess that
> > could be done... maybe by giving the sphere_sweep the
> > number of points as 'frame_number'. Or at least some
> > integer based on it. Then the points could be gathered
> > from an 'array', previously set up, invoking them via a
> > 'while' loop which uses the point count to pull them out
> > of the array.
> >
> > Make sense?
>
> Yes... I think so.  But I'm not sure I can pull that off.

Now I have tried while-looping the spline into the sphere_sweep. The thing
drew out a line alright, except it apparently only used the first and last
points. Nothing inbetween. As you might have a look at yourself using the
previous script and this in place of its sphere_sweep:


#local Frame=frame_number;
#local Points=0;

sphere_sweep {
 linear_spline
 Frame+1, // must have at least two points
 SpaceTime(0),1 // starting point
 #while (Points<Frame)
 SpaceTime(clock),1 // only last recognized?
 #local Points=Points+1;
 #end
pigment {color red 1}
}


If this were capable of storing each and every vector given it from the
spline and loop I think it'd work fine.

Bob H.


Post a reply to this message

From: Carl Hoff
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 20:05:47
Message: <4032ba6b@news.povray.org>
> > What you asked about the front/back or leading/trailing
> > sides is simply a matter of pulling a vector from out of the
> > spline by its time (or t) value. Such as I did to place the
> > light_source ahead of center. It's just any amount +/- of
> > the clock, in that example. And then the question about
> > going up walls would be done by adding y values to the
> > sphere_sweep and spline vectors.
>
> Thanks... that sounds simple enough.

Ummm... it just hit me that only takes care of forward and
back.  In 2D that's fine but if my bike climbs walls, I can
point it forward but how do I know the wheels will be on
the floor (or wall in this case)?  Think of unit vectors pointing
in the x/forward direction, y/upward direction, and z/left
direction coming from the point that's traveling along the
spline.  The above tells me how to define x but if I can climb
walls or fly I need to know how to find y or z.  One will
give me the other but at the moment I'm not sure how to
find either.

Carl


Post a reply to this message

From: Hughes, B 
Subject: Re: Light Cycle animation questions...
Date: 17 Feb 2004 21:21:28
Message: <4032cc28$1@news.povray.org>
"Carl Hoff" <hof### [at] wtnet> wrote in message news:4032ba6b@news.povray.org...
> > > What you asked about the front/back or leading/trailing
> > > sides is simply a matter of pulling a vector from out of the
> > > spline by its time (or t) value. Such as I did to place the
> > > light_source ahead of center. It's just any amount +/- of
> > > the clock, in that example. And then the question about
> > > going up walls would be done by adding y values to the
> > > sphere_sweep and spline vectors.
> >
> > Thanks... that sounds simple enough.
>
> Ummm... it just hit me that only takes care of forward and
> back.  In 2D that's fine but if my bike climbs walls, I can
> point it forward but how do I know the wheels will be on
> the floor (or wall in this case)?  Think of unit vectors pointing
> in the x/forward direction, y/upward direction, and z/left
> direction coming from the point that's traveling along the
> spline.  The above tells me how to define x but if I can climb
> walls or fly I need to know how to find y or z.  One will
> give me the other but at the moment I'm not sure how to
> find either.

You might be thinking too hard and overlooking the simplicity of it. The
splines have all three axes. Or I'm not thinking hard enough. Maybe you're
needing a way to create the path based on what the room shape is and
obstacles in it? If so, then 'trace' is probably the answer. That could be
applied to sense surroundings, but it can slow up animations.

I had figured you would be plotting out the path yourself though, in
advance. If that were the case, all you'd do is set the vectors to include
each value, i.e. <0,0,0> to <1,0,0> to <1,1,0> moves forward (+x) then stays
at x*1 but moves up y*1.

Hopefully I'm still shedding some light.


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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