Question

I would like the projection to be like this:

three-axis projection

That is, (x,y,z) -> (x-y/sqrt(2),y/sqrt(2)-z)

How to find the projection matrix?

Was it helpful?

Solution

I got this by using a simple camera:

var camera = new THREE.Camera();

Setting it's far and near views to big values:

camera.far=2000;
camera.near=-2000;

And setting a projection matrix like this:

camera.projectionMatrix = camera.projectionMatrix = new THREE.Matrix4(
            1,0,0.5,0,
            0,-1,-0.5,0,
            0,1,0,0,
            0,0,0,2000);

I'm not sure 0.5 is the right value (guess it should be 1/sqrt(2)) but it worked. Also, realizing how a projection matrix works was a fun insight. http://en.wikipedia.org/wiki/Projection_%28linear_algebra%29

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top