I'm working on a project using the three.js editor source code that you can download from the three.js website. As a part of the project I need to reorient the axes so that they can be aligned with standard coordinate axes used for airplanes (x-axis out the nose, y-axis out the left wing, z-axis down). The orientation I am describing can be seen when clicking on the link below: design axis orientation
In order to get this I have modified the index.html (in the editor folder), three.js (in the build folder), Editor.js (editor/js folder) files. After my modifications, detailed below, I can get the axes to rotate properly, but when I refresh/reload the page it breaks and no longer is in the orientation I need anymore. When I click File > New however, it reset and is exactly how I need it. Does anyone know why the code doesn't work when I reload the page?
Here are the modifications that I made to the code:
index.html (line 12):
<script src="../build/three.js"></script>
from
<script src="../build/three.min.js"></script>
this allows me to use the three.js file instead of the min.js file
three.js (lines 40581 and 40582):
vertices.push( - size, k, 0, size, k, 0 );
vertices.push( k, - size, 0, k, size, 0 );
from
vertices.push( - size, 0, k, size, 0, k );
vertices.push( k, 0, - size, k, 0, size );
this causes the grid to rotate 90 degrees, from horizontal to vertical.
Editor.js (line 9):
this.DEFAULT_CAMERA.position.set( -20, 20, -20 );
from
this.DEFAULT_CAMERA.position.set( 20, 10, 20 );
and I also added the line
this.DEFAULT_CAMERA.up.set( 0, 0, -1 );
directly below the camera position.set function.
These last edits is supposed to reorient the grid and axes so that it looks like the picture in the link above.