Skip to main content
gamedev.net
🔒 Locked

Add

Started by transoid Feb 2, 2003 at 2:47 AM 5 replies 300+ views
Original Post
transoid
transoid
Does anyone know how to add a graphical item on previous output? I am writting a program that outputs a trajectory of particle. In the program, the next point is calculated, and that point is connected from the previous point. What I am trying to do is that instead redrawing whole line over and over again, I was wondering if there is anyway I can just add the part of line from the previous output. Thanks in advance.
niyaw
niyaw
don''t clear screen between frames.
Hawkeye3
Hawkeye3
That''ll cause the whole screen to blur and eventually become unreadable? I think what he is trying to do is motion blur... there are several ways to do it. Try looking around on the net for some examples.
transoid
transoid
Very cute, Niyaw. Could you not write something more productive? If you meant by not clearing the buffer, that''s going to cause problem. And this is what I am trying to do. For exmaple, at first the output might look like

--------------->

then next would be

------------------>

Of course, it is straight line above, which would it make my life much easier, but there will be some curves in the program. Thanks for your help anyway.
BauerGL
BauerGL
I haven''t done this before, but you might consider it anyway. If all you want is a line following a projectile, you can probably make a line strip or similar. And each frame that the projectile moves you update the line strip with the new position. You can probably also do it with a triangle strip and then billboarding it, if you want more effects etc.
niyaw
niyaw
well, excuse me.
quote:
Original post by transoid
Does anyone know how to add a graphical item on previous output?


if you want to clear screen, destroying the output, you can''t add anything on it anymore. you can save the output, but that''s the same as not clearing the screen. there''s no magic here: if you want to keep the output, don''t destroy it; if you do destroy it, you can''t use it.

if plotting individual points requires significant computation time, save the already computed points and replot them without recomputing.
xiros
xiros
just save the screen, as niyaw said, before drawing the end arrow on the line, then recall that for your next frame. Just never draw the arrow before you save the screen. Draw it after instead.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.