Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

transoid

Add

This topic is 5770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!