diff --git a/02/index.html b/02/index.html new file mode 100644 index 00000000..21351db9 --- /dev/null +++ b/02/index.html @@ -0,0 +1,119 @@ + + + + + CS460 Assignment 2 + + + + + + + +

CS460 Assignment 2

+ + + \ No newline at end of file diff --git a/03/CS460_Assignment_03__Copy_ (1).pdf b/03/CS460_Assignment_03__Copy_ (1).pdf new file mode 100644 index 00000000..3145741e Binary files /dev/null and b/03/CS460_Assignment_03__Copy_ (1).pdf differ diff --git a/03/index.html b/03/index.html new file mode 100644 index 00000000..67f6295a --- /dev/null +++ b/03/index.html @@ -0,0 +1,169 @@ + + + + + + + + + + \ No newline at end of file diff --git a/04/CS460_Assignment_04__Copy_ (1).pdf b/04/CS460_Assignment_04__Copy_ (1).pdf new file mode 100644 index 00000000..f7d7cf75 Binary files /dev/null and b/04/CS460_Assignment_04__Copy_ (1).pdf differ diff --git a/04/index.html b/04/index.html new file mode 100644 index 00000000..9a8d3714 --- /dev/null +++ b/04/index.html @@ -0,0 +1,442 @@ + + + + + Vanilla WebGL! + + + + + + + + + + + +
0
+ + diff --git a/05/CS460_Assignment_05__Copy_.pdf b/05/CS460_Assignment_05__Copy_.pdf new file mode 100644 index 00000000..419ea3a0 Binary files /dev/null and b/05/CS460_Assignment_05__Copy_.pdf differ diff --git a/05/Robot.js b/05/Robot.js new file mode 100644 index 00000000..9bd71717 --- /dev/null +++ b/05/Robot.js @@ -0,0 +1,97 @@ +Robot = function(x,y,z) { + this.head = new THREE.Bone(); + this.head.position.set(x,y,z); + + + this.neck = new THREE.Bone(); + this.neck.position.y = -10; + + this.head.add(this.neck); + + this.torso = new THREE.Bone(); + this.torse.position.y = -30; + + this.neck.add(this.torso); + + this.left_upper_arm = new THREE.Bone(); + this.left_upper_arm.position.x = 10; + this.left_upper_arm.position.y = -5; + + this.neck.add(this.left_upper_arm); + + this.left_lower_arm = new THREE.Bone(); + this.left_lower_arm.position = 10; + this.left_lower_arm.position = -15; + + this.left_upper_arm.add(this.left_lower_arm); + + this.left_hand = new THREE.Bone(); + this.left_hand.position.x = 5; + + this.left_lower_arm.add(this.left_hand); + + this.right_upper_arm = new THREE.Bone(); + this.right_upper_arm.position.x = -10; + this.right_upper_arm.position.y = -5; + + this.neck.add(this.left_upper_arm); + + this.right_lower_arm = new THREE.Bone(); + this.right_lower_arm.position.x = -10; + this.right_lower_arm.position.y = -15; + + this.right_upper_arm.add(this.right_lower_arm); + + this.right_hand = new THREE.Bone(); + this.right_hand.position.x = -5; + + this.left_upper_leg = new THREE.Bone(); + this.left_upper_leg.position.x = 10; + this.left_upper_leg.position.y = -10; + + this.torso.add(this.left_upper_leg); + + this.left_lower_leg = new THREE.Bone(); + this.left_lower_leg.position.x = 10; + this.left_lower_leg.position.y = -10; + + this.left_upper_leg.add(this.left_lower_leg); + + this.right_upper_leg = new THREE.Bone(); + this.right_upper_leg.position.x = -10 + this.right_upper_leg.position.y = -10 + + this.torso.add(this.right_upper_leg); + + this.right_lower_leg = new THREE.Bone(); + this.right_lower_position.x = -10; + this.right_lower_position.y = -10; + + this.right_upper_leg.add(this.right_lower_leg); + + + this.movement = null; + +} + + +Robot.prototype.show = function(scene) { + var rGroup = new THREE.Group(); + rGroup.add(this.head); + + scene.add(rGroup); + + helper = new THREE.SkeletonHelper( rGroup); + helper.material.linewidth = 3; + + scene.add(rGroup); + scene.add(helper); + + +} + +Robot.prototype.raiseLeftArm = function() { + + this.movement = "raise left arm" + +} \ No newline at end of file diff --git a/06/Robot.js b/06/Robot.js new file mode 100644 index 00000000..f9c1b346 --- /dev/null +++ b/06/Robot.js @@ -0,0 +1,139 @@ +Robot = function(x,y,z) { + this.head = new THREE.Bone(); + this.head.position.set(x,y,z); + + + this.neck = new THREE.Bone(); + this.neck.position.y = -10; + + this.head.add(this.neck); + + this.torso = new THREE.Bone(); + this.torso.position.y = -30; + + this.neck.add(this.torso); + + this.left_upper_arm = new THREE.Bone(); + this.left_upper_arm.position.x = 10; + this.left_upper_arm.position.y = -5; + + this.neck.add(this.left_upper_arm); + + this.left_lower_arm = new THREE.Bone(); + this.left_lower_arm.position.x = 10; + this.left_lower_arm.position.y = -15; + + this.left_upper_arm.add(this.left_lower_arm); + + this.left_hand = new THREE.Bone(); + this.left_hand.position.x = 5; + + this.left_lower_arm.add(this.left_hand); + + this.right_upper_arm = new THREE.Bone(); + this.right_upper_arm.position.x = -10; + this.right_upper_arm.position.y = -5; + + this.neck.add(this.right_upper_arm); + + this.right_lower_arm = new THREE.Bone(); + this.right_lower_arm.position.x = -10; + this.right_lower_arm.position.y = -15; + + this.right_upper_arm.add(this.right_lower_arm); + + this.right_hand = new THREE.Bone(); + this.right_hand.position.x = -5; + + this.right_lower_arm.add(this.right_hand); + + this.left_upper_leg = new THREE.Bone(); + this.left_upper_leg.position.x = 10; + this.left_upper_leg.position.y = -10; + + this.torso.add(this.left_upper_leg); + + this.left_lower_leg = new THREE.Bone(); + this.left_lower_leg.position.x = 10; + this.left_lower_leg.position.y = -10; + + this.left_upper_leg.add(this.left_lower_leg); + + this.right_upper_leg = new THREE.Bone(); + this.right_upper_leg.position.x = -10; + this.right_upper_leg.position.y = -10; + + this.torso.add(this.right_upper_leg); + + this.right_lower_leg = new THREE.Bone(); + this.right_lower_leg.position.x = -10; + this.right_lower_leg.position.y = -10; + + this.right_upper_leg.add(this.right_lower_leg); + + + this.movement = null; + +} + + +Robot.prototype.show = function(scene) { + var rGroup = new THREE.Group(); + rGroup.add(this.head); + + scene.add(rGroup); + + helper = new THREE.SkeletonHelper( rGroup); + helper.material.linewidth = 3; + + scene.add(rGroup); + scene.add(helper); + + +} + +Robot.prototype.raiseLeftArm = function() { + + this.movement = 'raise left arm'; + +} + +Robot.prototype.lower_left_arm = function() { + this.movement = 'lower left arm' +} + +Robot.prototype.kick = function() { + this.movement = 'kick'; +} + +Robot.prototype.onAnimate = function() { + if (this.movement == 'raise left arm') { + var T = -Math.PI; + this.left_upper_arm.quaternion.slerp(new THREE.Quaternion(Math.sin(T/2), + 0, 0, Math.cos(T/2)), 0.1); + } + else if (this.movement == 'lower left arm') { + this.left_upper_arm.quaternion.slerp(new THREE.Quaternion(0,0,0,1), 0.1); + } + else if (this.movement == 'kick') { + if (this.right_upper_leg.quaternion.w < 0.72) { + + this.movement = 'kick done'; + + } + else { + var T = -Math.PI/2; + this.right_upper_leg.quaternion.slerp( new THREE.Quaternion + (Math.sin (T/2 ), + 0, + 0, + Math.cos(T/2)), 0.1); + } + + + } else if (this.movement == 'kick done') { + + this.right_upper_leg.quaternion.slerp( new THREE.Quaternion(0, 0, 0, 1), 0.1); + } + +} \ No newline at end of file diff --git a/06/index.html b/06/index.html index 81c698a3..268c657f 100644 --- a/06/index.html +++ b/06/index.html @@ -18,7 +18,12 @@ +<<<<<<< HEAD + + +======= +>>>>>>> 6a6b96e4d883f0379d7ee30b4db15eeb459da0ab