Adding a trail to a moving object

O

Oracle3001

Hi All,

I am moving a ball through a 3D space, and I want to add a 3D trail (a bit
like the way a comet has a trail) to this. What do people think is the best
way of doing this? I was kind of thinking of adding a cylinder, bit by bit,
as the ball moves. But I was wondering if there is a better way?

Adam
 
V

visionset

Oracle3001 said:
Hi All,

I am moving a ball through a 3D space, and I want to add a 3D trail (a bit
like the way a comet has a trail) to this. What do people think is the best
way of doing this? I was kind of thinking of adding a cylinder, bit by bit,
as the ball moves. But I was wondering if there is a better way?

Easiest way is to only explicitly call repaint after the ball has moved a
bit.
You could repaint in a separate thread that sleeps and repaints, or you
could repaint after the pointer has moved a certain distance (best way by
pythag).
 
O

Oracle3001

I actually want to draw a curved tube that looks this a trail from the ball
position, but have no idea about how to form the geometry required for this.

Adam
 
C

Chris Uppal

Oracle3001 said:
I am moving a ball through a 3D space, and I want to add a 3D trail (a bit
like the way a comet has a trail) to this. What do people think is the
best way of doing this? I was kind of thinking of adding a cylinder, bit
by bit, as the ball moves. But I was wondering if there is a better way?

You might find it easier to reflect that the optical effect of trails left
behind moving objects is happening in the eye/brain, not out in 3D space.

If you look at it that way then you render the current position of the ball in
the normal 3D way at starting time T0; and then when it comes to rendering the
next frame at T1 you overlay the new 3D rendering over a "faded" version of the
previous frame. Then you render T2 on top of the previous result, and so on,
fading each time. The end effect is that any moving objects will leave an
authentic (well, moderately) trail behind them.

I have no idea whether that would *actually* be easier -- it depends on the
nature of your app, and of the 3D API you are using (if any).

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top