www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: hunt210 on May 02, 2014, 08:26:14 am

Title: Making a 3D version of Conway's Game of Life, can't make a "cross-hairs"
Post by: hunt210 on May 02, 2014, 08:26:14 am
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
Title: Re: Making a 3D version of Conway's Game of Life, can't make a "cross-hairs"
Post by: EgonOlsen on May 03, 2014, 02:22:53 pm
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>);)