{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/8459","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/8459/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/8459/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/8459/events","html_url":"https://github.com/mrdoob/three.js/issues/8459","id":143204891,"number":8459,"title":"X, Y and Z axes as default values in three.js core","user":{"login":"Wilt","id":2419627,"avatar_url":"https://avatars.githubusercontent.com/u/2419627?v=3","gravatar_id":"","url":"https://api.github.com/users/Wilt","html_url":"https://github.com/Wilt","followers_url":"https://api.github.com/users/Wilt/followers","following_url":"https://api.github.com/users/Wilt/following{/other_user}","gists_url":"https://api.github.com/users/Wilt/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilt/subscriptions","organizations_url":"https://api.github.com/users/Wilt/orgs","repos_url":"https://api.github.com/users/Wilt/repos","events_url":"https://api.github.com/users/Wilt/events{/privacy}","received_events_url":"https://api.github.com/users/Wilt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-24T10:04:30Z","updated_at":"2016-03-24T12:51:16Z","closed_at":null,"body":"##### Description of the feature request/enhancement\r\n\r\nI notice that I often have to use xAxis, yAxis and zAxis in my three.js application.\r\nBecause of this I repeatingly end up creating new `Vector3` objects whenever I need these axes, which seems a bit unnecessary. Would it be possible to make default axes part of the core?\r\nSomething like:\r\n\r\n    THREE.Default.XAxis = new THREE.Vector3( 1, 0, 0 );\r\n    THREE.Default.YAxis = new THREE.Vector3( 0, 1, 0 );\r\n    THREE.Default.ZAxis = new THREE.Vector3( 0, 0, 1 );\r\n\r\nOr alternatively: \r\n\r\n    THREE.Axes.X = new THREE.Vector3( 1, 0, 0 );\r\n    THREE.Axes.Y = new THREE.Vector3( 0, 1, 0 );\r\n    THREE.Axes.Z = new THREE.Vector3( 0, 0, 1 );\r\n\r\nSimilarly there is the `THREE.Object3D.DefaultUp = new THREE.Vector3( 0, 1, 0 );`\r\nthis could then maybe be replaced with:\r\n\r\n    THREE.Default.Up = THREE.Default.YAxis\r\n\r\nI can make a pull request, but I just need some guidance on where to put them.\r\n\r\nThey could immediately be used in the three js code. For example in the `THREE.Object3D` methods `rotateX`, `rotateY` and `rotateZ`:\r\n\r\n\trotateX: function () {\r\n\t\tvar v1 = THREE.Default.XAxis;\r\n\t\treturn function ( angle ) {\r\n\t\t\treturn this.rotateOnAxis( v1, angle );\r\n\t\t};\r\n\t}(),\r\n\r\n\trotateY: function () {\r\n\t\tvar v1 = THREE.Default.YAxis;\r\n\t\treturn function ( angle ) {\r\n\t\t\treturn this.rotateOnAxis( v1, angle );\r\n\t\t};\r\n\t}(),\r\n\r\n\trotateZ: function () {\r\n\t\tvar v1 = THREE.Default.ZAxis;\r\n\t\treturn function ( angle ) {\r\n\t\t\treturn this.rotateOnAxis( v1, angle );\r\n\t\t};\r\n\t}(),\r\n\r\nAnd probably on more places."},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/200818611","html_url":"https://github.com/mrdoob/three.js/issues/8459#issuecomment-200818611","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/8459","id":200818611,"user":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T12:51:16Z","updated_at":"2016-03-24T12:51:16Z","body":"I've done this pattern before.  I usually put these on the Vector3 class or what ever class type the consts are:\r\n\r\n```\r\nTHREE.Vector3.Zero = new THREE.Vector3( 0, 0, 0 );\r\nTHREE.Vector3.XAxis = new THREE.Vector3( 1, 0, 0 );\r\n...\r\nTHREE.Vector4.WAxis = new THREE.Vector4( 0, 0, 0, 1 );\r\n...\r\nTHREE.Box3.Empty = new THREE.Box3();\r\n...\r\nTHREE.Sphere.Unit = new THREE.Sphere( 1, new THREE.Vector3.Zero.clone() );\r\n```\r\n\r\nBut with JavaScript this is all fairly dangerous to do because these values are not truly const, so I am not sure this is a great idea."}}