mrdoob/three.js — Issue #1016: FlyControls with fixed object
Author: wonc
Created: 2012-01-03 19:57:02+00:00
State: open

Hi,

I'm pretty new to 3D programming so bare with me! I've programmed in OpenGL and I'm pretty comfortable with it, but WebGL and Threejs are still new to me.

I'm working on a space-shooter type game using FlyControls, and my goal is to have my "ship" object centered on the screen while the rest of the scene orients according to the controls. I can get this effect by creating a separate scene/camera for the ship and another for the environment, however I can see this being a problem when handling collision detection since the coordinate frames won't be the same.

I've also considered trying to pull out the transformation carried out by the controls and applying the inverse of this transformation to the ship, but again I'm unsure as to what exactly each matrix is responsible for (eg: matrix, matrixRotationWorld, matrixWorld, etc..).

Any help would be appreciated, thanks!