Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    3D Position to Screen Position

    Advanced
    3
    5
    481
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Slydog last edited by

      I'm wanting to spawn a 2D explosion in my 3D world.
      I didn't see any animated 3D explosions in the gallery, as that would have been my first option.

      How do I figure out where to draw a 2D graphic at a 3D world position (eg. where the enemy model is)?
      I need a '3D point to 2D position' conversion function.

      I could make and spawn my own 3D particle system (using cubes?), but that's seems like too much work.

      Right now, I just delete the enemy from the screen instantly when shot, so is barely noticeable.
      Or what other technique could I use?

      1 Reply Last reply Reply Quote 2
      • PickleCatStars
        PickleCatStars F last edited by

        I have seen formulas for this online, but have not tried them myself.

        I once made a very simple ’explosion’ out of a sphere. Set it to orange, semi-transparent. Experiment with size changes and colour fades, I’m sure you’ll come up with something :)

        1 Reply Last reply Reply Quote 2
        • PickleCatStars
          PickleCatStars F last edited by

          The terrain function also has transparencies now, you could wangle something explosion looking out of one of those, maybe.

          1 Reply Last reply Reply Quote 1
          • S
            Slydog last edited by

            I was thinking about the sphere idea, and may give that a go.

            BUT, I'm loving the terrain idea! I could spawn a small terrain tile at the enemy's position, with a circular (or rectangular) shape, with heights and color matching the enemy, and reduce the heights over time to appear like the enemy 'melts' into the ground. maybe changing colors and alpha along the way. Maybe combine that with a red sphere expanding and fading.

            It at least looks good in my head. Will get on that! Thanks for the idea!

            Spacemario 1 Reply Last reply Reply Quote 3
            • Spacemario
              Spacemario F @Slydog last edited by

              @Slydog I did a bunch of digging into this-- you need use "matrix math" to calculate the projection. There's a whole Wikipedia article about it. One article had a painting of a guy from the 18th century or some crazy thing (wish I could find it), drawing a string through a wooden frame, explaining to someone how to do that math-- it was fascinating to me that this concept predates computers by hundreds of years!

              https://en.wikipedia.org/wiki/3D_projection

              1 Reply Last reply Reply Quote 1
              • First post
                Last post