display a 3D animated trajectory

SamueleSamuele Posts: 1Member

Hello everybody,
I'm making a pool game and I'm trying to display an animated curved trajectory, a dashed line or a stripe, over the table from the white ball forward (it could be curved depending on the spin).

how can I draw such animated dashed line or stripe over the table?

I don't know where to start, Sprite3d ? drawing on table surface but how?

In my understanding this is not a navigation thing neither is drawing on camera view port because other balls/objects might partially occlude the trajectory, so I'm pretty lost.

thank you in advance

Answers

  • jjmontesjjmontes Posts: 13Member
    edited November 20

    My two cents. I'd consider:

    • a particle system
    • a bunch of spheres / objects animated programatically
    • a custom line in 3D

    I think I'd go for the second option, since there are not that many points in such a trajectory and you'd have easy control over appearance and animation.

    If however, you strictly want a dashed line or continuous stripe, you can construct the geometry yourself using the geometry builder helpers (https://docs.godotengine.org/en/3.2/tutorials/content/procedural_geometry/index.html). In these cases, the difference between dashed and continuous is usually managed in the texture or shader.

    I do not recommend using Sprites for this. It's costly (updating them in video memory) and has more drawbacks I guess.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file