This discussion is archived
1 Reply Latest reply: Nov 10, 2012 4:18 AM by 973445 RSS

Bounce in 3D

973445 Newbie
Currently Being Moderated
Hi everybody,

I googled for instructions how to make 3D bouncing, but I have not found anything. Can anybody help me, please?

I am beginner with programming and I will be thankful for any advice.
  • 1. Re: Bounce in 3D
    jsmith Guru
    Currently Being Moderated
    Physics background:

    Programmatic formula (elastic deflection section) - you'll need to convert that code snippet to Java:

    Quoting a gamedev forum 2d answer (last post here:
    the reflected vector is: V - 2N(N.V) where N.V is the dot product of N and V, if you don't know what the dot procut is, then N.V = Nx*Vx + Ny*Vy, so that you end up with the vector { Vx - 2*Nx*dot, Vy - 2*Ny*dot } <-- no trigonometric functions needed.
    Just use 3d vectors (with z coords) rather than a 2d ones with only x and y. Also reduce the velocity to account for the energy lost in the bounce.

    You'll find the functions you need in the Point3D class:
    Use jdk8 to get a version of JavaFX that includes these methods:


  • Correct Answers - 10 points
  • Helpful Answers - 5 points