Skip to content
Snippets Groups Projects
Commit 8fb43768 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

rotation center on component

parent 4d9d7ade
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ ...@@ -18,6 +18,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
this.isStatic = json.isStatic; this.isStatic = json.isStatic;
this.rotary = json.rotary; this.rotary = json.rotary;
this.motionVector = new THREE.Vector3(); this.motionVector = new THREE.Vector3();
if (json.centerOfRotation) this.centerOfRotation = new THREE.Vector3(json.centerOfRotation.x, json.centerOfRotation.y, json.centerOfRotation.z);
if (json.motionVector) this.motionVector.set(json.motionVector.x, json.motionVector.y, json.motionVector.z); if (json.motionVector) this.motionVector.set(json.motionVector.x, json.motionVector.y, json.motionVector.z);
} }
...@@ -219,7 +220,8 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ ...@@ -219,7 +220,8 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
rotation: this.object3D.rotation, rotation: this.object3D.rotation,
isStatic: this.isStatic, isStatic: this.isStatic,
rotary: this.rotary, rotary: this.rotary,
motionVector: this.motionVector motionVector: this.motionVector,
centerOfRotation: this.centerOfRotation
} }
}; };
......
...@@ -44,11 +44,17 @@ Parent:    ...@@ -44,11 +44,17 @@ Parent:   
<input id="isRotary" data-property="rotary" type="checkbox" <% if (thisComponent.rotary){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="component custom-checkbox"> <input id="isRotary" data-property="rotary" type="checkbox" <% if (thisComponent.rotary){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="component custom-checkbox">
<span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Rotary Axis (default is Linear)</label> Rotary Axis (default is Linear)</label>
Vector (xyz):&nbsp;&nbsp; Vector of Motion (xyz):<br/>
<input data-property="motionVector" data-key="x" value="<%= thisComponent.motionVector.x %>" placeholder="X" class="form-control floatInput component" type="text">&nbsp; <input data-property="motionVector" data-key="x" value="<%= thisComponent.motionVector.x %>" placeholder="X" class="form-control floatInput component" type="text">&nbsp;
<input data-property="motionVector" data-key="y" value="<%= thisComponent.motionVector.y %>" placeholder="Y" class="form-control floatInput component" type="text">&nbsp; <input data-property="motionVector" data-key="y" value="<%= thisComponent.motionVector.y %>" placeholder="Y" class="form-control floatInput component" type="text">&nbsp;
<input data-property="motionVector" data-key="z" value="<%= thisComponent.motionVector.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/> <input data-property="motionVector" data-key="z" value="<%= thisComponent.motionVector.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/>
<!--Jog<br/>--> <% if (thisComponent.rotary){ %>
Center of Rotation, relative to Origin (xyz):<br/>
<input data-property="centerOfRotation" data-key="x" value="<%= thisComponent.centerOfRotation.x %>" placeholder="X" class="form-control floatInput component" type="text">&nbsp;
<input data-property="centerOfRotation" data-key="y" value="<%= thisComponent.centerOfRotation.y %>" placeholder="Y" class="form-control floatInput component" type="text">&nbsp;
<input data-property="centerOfRotation" data-key="z" value="<%= thisComponent.centerOfRotation.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/>
<% } %>
Jog: &nbsp;&nbsp;<br/>
<% } %> <% } %>
<br/> <br/>
<a id="uploadStl" href="#" class="btn btn-block btn-lg btn-default">Upload STL</a><br/> <a id="uploadStl" href="#" class="btn btn-block btn-lg btn-default">Upload STL</a><br/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment