Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final Project_VK #502

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
51a14f7
Add files via upload
vidhathrikasagani Sep 13, 2022
74426dd
Add files via upload
vidhathrikasagani Sep 19, 2022
b914496
Add files via upload
vidhathrikasagani Sep 19, 2022
4bd5b76
Delete 460 assignment 2.html
vidhathrikasagani Sep 19, 2022
4b4f15f
Add files via upload
vidhathrikasagani Sep 19, 2022
5cf352d
Delete a.html
vidhathrikasagani Sep 19, 2022
914196c
Add files via upload
vidhathrikasagani Sep 19, 2022
7425127
Merge branch 'bostongfx:main' into main
vidhathrikasagani Sep 19, 2022
ca3edcb
Delete a.html
vidhathrikasagani Sep 19, 2022
190bfd0
Delete index.html
vidhathrikasagani Sep 20, 2022
c96d412
Add files via upload
vidhathrikasagani Sep 20, 2022
0fc3122
Delete index.html
vidhathrikasagani Sep 20, 2022
755bad0
Add files via upload
vidhathrikasagani Sep 20, 2022
527707f
Delete a2.html
vidhathrikasagani Sep 20, 2022
1ea2281
Add files via upload
vidhathrikasagani Sep 20, 2022
b14fa49
Update a_2.html
vidhathrikasagani Sep 20, 2022
66bee73
Add files via upload
vidhathrikasagani Sep 20, 2022
34c2cae
Add files via upload
vidhathrikasagani Sep 27, 2022
0cfc62b
Add files via upload
vidhathrikasagani Sep 27, 2022
810acef
Create 04
vidhathrikasagani Oct 10, 2022
c07ed9d
Add files via upload
vidhathrikasagani Oct 10, 2022
d1bf09c
Add files via upload
vidhathrikasagani Oct 10, 2022
dabbf5c
Add files via upload
vidhathrikasagani Oct 10, 2022
fed33aa
Add files via upload
vidhathrikasagani Oct 18, 2022
93d902e
Add files via upload
vidhathrikasagani Oct 18, 2022
c8b5279
Add files via upload
vidhathrikasagani Oct 27, 2022
07de083
Delete index6.html
vidhathrikasagani Oct 27, 2022
601d128
Delete robot.js
vidhathrikasagani Oct 27, 2022
333aafb
Add files via upload
vidhathrikasagani Oct 27, 2022
24bfec4
Add files via upload
vidhathrikasagani Oct 27, 2022
db7fb1d
Create read
vidhathrikasagani Nov 8, 2022
14ec6f5
Add files via upload
vidhathrikasagani Nov 8, 2022
4c03b71
Add files via upload
vidhathrikasagani Nov 8, 2022
e26dbfc
Add files via upload
vidhathrikasagani Nov 8, 2022
131070c
Create A
vidhathrikasagani Nov 22, 2022
7e94e14
Add files via upload
vidhathrikasagani Nov 22, 2022
6aa4583
Add files via upload
vidhathrikasagani Nov 22, 2022
ddc74d1
Add files via upload
vidhathrikasagani Nov 22, 2022
5bfeb7f
Delete robot.js
vidhathrikasagani Nov 22, 2022
4362825
Delete index.html
vidhathrikasagani Nov 22, 2022
2160343
Add files via upload
vidhathrikasagani Nov 22, 2022
270e8eb
Delete index.html
vidhathrikasagani Nov 22, 2022
7e9969c
Delete robot.js
vidhathrikasagani Nov 22, 2022
26442f3
Add files via upload
vidhathrikasagani Nov 22, 2022
2aa1fd2
Add files via upload
vidhathrikasagani Nov 22, 2022
d15a28b
Delete A
vidhathrikasagani Nov 22, 2022
15129f3
Create A
vidhathrikasagani Nov 29, 2022
060f252
Add files via upload
vidhathrikasagani Nov 29, 2022
1acc4b1
Delete index.html
vidhathrikasagani Nov 29, 2022
c1af07a
Add files via upload
vidhathrikasagani Nov 29, 2022
433108b
Delete index.html
vidhathrikasagani Nov 29, 2022
93811ab
Add files via upload
vidhathrikasagani Nov 29, 2022
e61eb97
Delete index.html
vidhathrikasagani Nov 29, 2022
d34e0c6
Add files via upload
vidhathrikasagani Nov 29, 2022
b4c30f4
Delete index.html
vidhathrikasagani Nov 29, 2022
500a766
Add files via upload
vidhathrikasagani Nov 29, 2022
5f2365e
Add files via upload
vidhathrikasagani Nov 29, 2022
ea2c198
Create A
vidhathrikasagani Dec 9, 2022
132e914
Add files via upload
vidhathrikasagani Dec 9, 2022
55c51b0
Delete DS_Store
vidhathrikasagani Dec 9, 2022
21cbc26
Delete backup.txt
vidhathrikasagani Dec 9, 2022
c1bd527
Delete base64.js
vidhathrikasagani Dec 9, 2022
77bcfdc
Delete cube.gltf
vidhathrikasagani Dec 9, 2022
0fe46dc
Delete cube.ply
vidhathrikasagani Dec 9, 2022
b59aa45
Delete gltf.py
vidhathrikasagani Dec 9, 2022
259bc9a
Delete index.html
vidhathrikasagani Dec 9, 2022
caa6c8d
Add files via upload
vidhathrikasagani Dec 9, 2022
a8324aa
Delete 10 directory
vidhathrikasagani Dec 9, 2022
c4830f2
Create A
vidhathrikasagani Dec 9, 2022
2bc3373
Add files via upload
vidhathrikasagani Dec 9, 2022
db95beb
Add files via upload
vidhathrikasagani Dec 9, 2022
ad43db9
Delete 10 directory
vidhathrikasagani Dec 9, 2022
1aa98bc
Create A
vidhathrikasagani Dec 9, 2022
0e36191
Add files via upload
vidhathrikasagani Dec 9, 2022
82b435a
Add files via upload
vidhathrikasagani Dec 9, 2022
c51a637
Create A
vidhathrikasagani Dec 21, 2022
3affacb
Add files via upload
vidhathrikasagani Dec 22, 2022
a4914f9
Delete CS460_Final_Project_Report.pdf
vidhathrikasagani Dec 22, 2022
953e314
Add files via upload
vidhathrikasagani Dec 22, 2022
902043c
Delete CS460_Final_Project_Report.pdf
vidhathrikasagani Dec 22, 2022
6d17b9b
Add files via upload
vidhathrikasagani Dec 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 02/MY_CS460_Assignment_02_VK-3.pdf
Binary file not shown.
107 changes: 107 additions & 0 deletions 02/a_2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>CS460 Assignment 2</title>
<style>
body {
background-color: black;
color: white; /* font color */
font-family: sans-serif;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden !important;
}

#logo {
position: absolute;
right: 10px;
top: 10px;
}
</style>

<script type="text/javascript" src="https://get.goXTK.com/xtk_edge.js"></script>

<script type="text/javascript">

window.onload = function() {

// this gets called when the site is ready

// create a new scene and renderer
r = new X.renderer3D();
r.init();

draw_row([0,0,0],1, [1,1,1]); // start, howmany, color
draw_row([6*25,0,0],1, [1,1,1]);

draw_row([0,-25,0],2, [1,1,1]);
draw_row([5*25,-25,0],2, [1,1,1]);

draw_row([0,-25*2,0], 7, [1,1,1]);

eyes = [];
draw_row([0,-25*3,0], 1, [1,1,1]);
draw_row([25,-25*3,0], 2, [1,1,0], true);
draw_row([75,-25*3,0], 1, [1,1,1]);
draw_row([100,-25*3,0], 2, [1,1,0], true);
draw_row([150,-25*3,0], 1, [1,1,1]);

draw_row([0,-25*4,0], 7, [1,1,1]);
draw_row([0,-25*5,0], 7, [1,0,0]);

draw_row([25,-25*6,0], 2, [1,1,1]);
draw_row([75,-25*6,0], 1, [1,0,0]);
draw_row([100,-25*6,0], 2, [1,1,1]);

draw_row([20,-25*7,0], 6, [1,1,1]);
draw_row([20,-25*8,0], 6, [1,1,1]);


r.camera.position = [0,0,1000];

// render everything!
r.render();

eyesclosed = false;
setInterval(function() {
if (eyesclosed) {
// open the eyes
for (e in eyes) {
eyes[e].color = [1,1,0];
}
eyesclosed = false;
} else {
// close the eyes
for (e in eyes) {
eyes[e].color = [1,1,1];
}
eyesclosed = true;
}

},1000);

};

function draw_row(start, howmany, color, keeptrack) {

var gap=2;

for (var i=0; i<howmany; i++) {

c = new X.cube();
c.color = color;
c.center = [start[0]+i*20+i*5, start[1], start[2]];
r.add(c);
if (keeptrack) {
eyes.push(c);
}

}

}

</script>
</head>
</html>
Binary file added 03/CS460_Assignment_03_VK-2.pdf
Binary file not shown.
131 changes: 131 additions & 0 deletions 03/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<html>
<head>
<meta charset="UTF-8" />
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden !important;
}
</style>
<script src="https://threejs.org/build/three.min.js" type="text/javascript"></script>
<script src="https://threejs.org/examples/js/controls/TrackballControls.js" type="text/javascript"></script>
<script>


function getRandomColor() {

function getRandomRGB() {
return Math.floor(Math.random()*256);
}

return {color: `rgb(${getRandomRGB()}, ${getRandomRGB()}, ${getRandomRGB()})`};
}

function getRandomGeometry() {
function getRandomCase() {
return Math.floor(Math.random() * 5)
}

switch(getRandomCase()) {
case 0:
return new THREE.RingGeometry(10, 20, 24);

case 1:
return new THREE.ConeGeometry(15, 40);
case 2:
return new THREE.SphereGeometry(20, 20, 20);
case 3:
return new THREE.OctahedronGeometry(30);
case 4:
return new THREE.TorusKnotGeometry(30, 8, 40, 10);
case 5:
return new THREE.BoxGeometry(15, 15, 15);
}
}

var global_counter = 0;
window.onload = function() {

scene = new THREE.Scene();

fov = 75; /degrees corresponds to up and down that constitutes frustrum/
ratio = window.innerWidth / window.innerHeight;
zNear = 1;
zFar = 10000;

camera = new THREE.PerspectiveCamera(fov, ratio, zNear, zFar);
camera.position.set( 0, 0, 500);
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild(renderer.domElement );
geometry = new THREE.PlaneGeometry( 10000, 10000 );
material = new THREE.MeshBasicMaterial( {
visible: false
});

invisible_plane = new THREE.Mesh( geometry, material);
scene.add(invisible_plane);
renderer.domElement.onmousemove = function( e ){

if(!e.shiftKey) return false;

pixel_coords = new THREE.Vector2( e.clientX, e.clientY);

vp_coords = new THREE.Vector2(
( pixel_coords.x / window.innerWidth ) * 2 - 1,
-( pixel_coords.y / window.innerHeight ) * 2 + 1)

vp_coords_near = new THREE.Vector3( vp_coords.x, vp_coords.y, 0);
raycaster = new THREE.Raycaster();
raycaster.setFromCamera(vp_coords_near, camera);

intersects = raycaster.intersectObject(invisible_plane);
p = intersects[0].point;

geometry = getRandomGeometry();
material = new THREE.MeshStandardMaterial(getRandomColor());
cube = new THREE.Mesh( geometry, material);
scene.add(cube);
cube.position.set(p.x, p.y, p.z);
global_counter++;
console.log(global_counter);

};

ambientLight = new THREE.AmbientLight( 0x404040 );
scene.add( ambientLight );

light = new THREE.DirectionalLight( 0xd2ded2, 5.0);
light.position.set( 20, 100, 20 );
scene.add(light);

geometry = new THREE.BoxGeometry( 40, 40, 40);
material = new THREE.MeshStandardMaterial(getRandomColor());
cube = new THREE.Mesh( geometry, material);
scene.add(cube);

controls = new THREE.TrackballControls( camera, renderer.domElement );

animate();

};

function animate() {

requestAnimationFrame( animate );



controls.update();


renderer.render( scene, camera);

};
</script>
</head>
<body></body>
</html>
1 change: 1 addition & 0 deletions 04
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added 07/CS460_Assignment_07__Copy_ (1).pdf
Binary file not shown.
Binary file added 07/CS460_Assignment_07__Copy_.pdf
Binary file not shown.
Binary file added 07/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 07/board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions 07/helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
HELPER = {};

HELPER.cylinderSkeletonMesh = function(howmany, howwide, color) {

var segmentheight = 10;
var height = segmentheight * howmany;

var geometry = new THREE.CylinderBufferGeometry(
howwide,
howwide,
height,
8,
howmany * 3,
true
);

var position = geometry.attributes.position;

var vertex = new THREE.Vector3();

var skinIndices = [];
var skinWeights = [];

for ( var i = 0; i < position.count; i ++ ) {

vertex.fromBufferAttribute( position, i );

var y = ( vertex.y + height / 2 );

var skinIndex = Math.floor( y / segmentheight );
var skinWeight = ( y % segmentheight ) / segmentheight;

skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );
skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );

}

geometry.setAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) );
geometry.setAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) );


var material = new THREE.MeshStandardMaterial( {
skinning: true,
color: color,
side: THREE.DoubleSide,
flatShading: true
} );


var bones = [];


var parentbone = new THREE.Bone();

bones.push(parentbone);

for (var i=0; i< howmany; i++) {

var currentbone = new THREE.Bone();
currentbone.position.y = segmentheight;

parentbone.add(currentbone);
bones.push(currentbone);
parentbone = currentbone;

}

return [geometry, material, bones];

};
Loading