3rd person

Well its more of a math question than anything else.

I have my camera and I want to place an object in front of it. I have a position coord and a view coord (and thus also a direction vector).

The best approach to this, should I place obj at view coords?, link it directly to Camera?.. anyone had any experience witht his?

Well, if you have your camera’s location and view you can determine the location of any point on the line.


Vector3f loc = camera.getLocation();
loc = loc.add(camera.getView().mult(CHARACTER_DISTANCE));
character.setLocation(loc);

That will keep the character in the camera’s view and at a certain distance at all times.