Author Topic: Making a 3D version of Conway's Game of Life, can't make a "cross-hairs"  (Read 908 times)

Offline hunt210

  • byte
  • *
  • Posts: 1
    • View Profile
The basic idea I have is to make a tiny Primitive sphere that follows the location of the camera at all times.  I only want this in the game so that the user can always tell where they are adding/removing cells.  I know in my gut that the solution is simple but I've been banging my head against this issue for hours now

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11983
    • View Profile
You can get the camera's position in world space from the camera. Then get the current view direction via camera.getBack().getZAxis(). Multiply that with some value (10,20,...40...) and add it to the position. Try to use that as the new position of your sphere (sphere.clearTranslation(); sphere.translate(<newPosition>);)