Skip to content Skip to sidebar Skip to footer

How To Do This Coordinate System Operation More Efficiently?

I'm making a 3D game, where the player's back should always be facing the camera and he should move in that direction. I didn't come to the 'back facing the camera' part yet, but I

Solution 1:

There is nothing to make more efficient here, these calculations are standard stuff for 3D scenes.

Don't optimize prematurely. There is no way this stuff is a bottleneck in your app.

Remember, even if these calculations happen on each render(), they still only happen once every several milliseconds - 17ms assuming 60 FPS, which is a lot. Math.sin() / Math.cos() / Math.sqrt() are plenty efficient, and lots of other calculations happen on each render() that are much more complex.

You'll be just fine with what you have now.

Post a Comment for "How To Do This Coordinate System Operation More Efficiently?"