add turtle and zoom buttons

pull/29/head
Michael Aschauer 2017-01-26 13:19:27 +01:00
rodzic a4102f3647
commit ea7fee49e2
4 zmienionych plików z 1223 dodań i 5 usunięć

Wyświetl plik

@ -21,14 +21,15 @@
<script type="text/javascript" src="sha512.js"></script>
<script type="text/javascript" src="FileSaver.min.js"></script>
<!-- turtlestitch requirements -->
<!-- third party libs -->
<script type="text/javascript" src="stitchcode/jquery.js"></script>
<script type="text/javascript" src="stitchcode/three.js"></script>
<script type="text/javascript" src="stitchcode/OrbitControls.js"></script>
<script type="text/javascript" src="stitchcode/OBJLoader.js"></script>
<!-- turtlestitch additions -->
<script type="text/javascript" src="stitchcode/turtleShepherd.js"></script>
<!-- turtlestitch mods -->
<script type="text/javascript" src="stitchcode/blocks.js"></script>
<script type="text/javascript" src="stitchcode/blocks.js"></script>
<script type="text/javascript" src="stitchcode/objects.js"></script>
<script type="text/javascript" src="stitchcode/gui.js"></script>
<script type="text/javascript" src="stitchcode/gui-cloud.js"></script>

Plik diff jest za duży Load Diff

Wyświetl plik

@ -777,6 +777,26 @@ IDE_Morph.prototype.createStatusDisplay = function () {
elements.push(toogleTurtleButton);
elements.push('-');
var zoomInButton = new PushButtonMorph(
null,
function () {
stage.camera.zoomOut();
stage.renderer.changed = true; },
'+'
);
elements.push(zoomInButton);
var zoomOutButton = new PushButtonMorph(
null,
function () {
stage.camera.zoomIn();
stage.renderer.changed = true;
},
' - '
);
elements.push(zoomOutButton);
var resetCameraButton = new PushButtonMorph(
null,
function () { stage.camera.reset(); },

Wyświetl plik

@ -540,10 +540,25 @@ StageMorph.prototype.initTurtle = function() {
];
geometry.faces.push(new THREE.Face3(0, 1, 2));
geometry.verticesNeedUpdate = true;
this.turtle = new THREE.Mesh( geometry, material );
this.turtle = new THREE.Mesh(new THREE.Geometry(), material);
this.turtle.visible = this.renderer.showingTurtle;
myself.myObjects.add(this.turtle);
if (typeof this.turtle.loaded === 'undefined') {
var loader = new THREE.OBJLoader();
loader.load('stitchcode/assets/turtle.obj', function (object) {
this.turtle = object;
object.scale.set(4, 4, 4);
object.position.z = 0.03;
//object.position.set(0,0, 0.01);
object.rotation.x = 90 * Math.PI / 180;
object.rotation.y = 270 * Math.PI / 180;
myself.turtle.add(object);
myself.renderer.changed = true;
this.turtle.loaded = true;
});
}
this.drawingColor = new THREE.Color("rgb(0, 0, 0)");
this.penSize = 1.2;
};