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 #243

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
453059c
Assignment 1 finished by Shijie An
Mushaddict Sep 7, 2019
ef06713
Merge branch 'master' of https://github.com/bostongfx/cs460student
Mushaddict Sep 9, 2019
04d7ebd
Assignment 2 done
Mushaddict Sep 16, 2019
c6f0e52
assignment 3 done
Mushaddict Sep 23, 2019
79c6da7
assignment3 done
Mushaddict Sep 23, 2019
f901079
assignment 4 done
Mushaddict Oct 2, 2019
a4f6142
assignment 4 done
Mushaddict Oct 2, 2019
aabe202
not done yet
Mushaddict Oct 9, 2019
8c75509
file upload
Mushaddict Oct 11, 2019
1bfaf2a
assignment 5 done
Mushaddict Oct 11, 2019
a7e5e53
Update README.md
Mushaddict Oct 18, 2019
823613b
some file
Mushaddict Oct 21, 2019
7020cbe
Working
Mushaddict Oct 26, 2019
f8172f1
changed
Mushaddict Oct 26, 2019
a8c986c
coding done
Mushaddict Oct 28, 2019
ebc6984
assignment 6 done
Mushaddict Oct 28, 2019
1e239a6
sth in class add up
Mushaddict Nov 4, 2019
4445ee2
some basic files
Mushaddict Nov 11, 2019
c659050
updating line 67
Mushaddict Nov 11, 2019
ebddb4e
assignment7 done
Mushaddict Nov 12, 2019
0a917e8
some files uploading
Mushaddict Nov 12, 2019
2a586fc
basic files
Mushaddict Nov 16, 2019
e6c334d
onStep updated
Mushaddict Nov 16, 2019
81dab77
parenthesis changed --> walk
Mushaddict Nov 16, 2019
108e255
screenshot uploaded
Mushaddict Nov 16, 2019
a62c36d
Delete CS460_Assignment_08__Copy_.pdf
Mushaddict Nov 16, 2019
a6b56ec
hw8 done
Mushaddict Nov 16, 2019
caf6197
'ply' files uploaded
Mushaddict Nov 25, 2019
4a0327d
half-way change material
Mushaddict Nov 25, 2019
9d4f1db
gui updated
Mushaddict Nov 25, 2019
b6d0de4
file uploaded
Mushaddict Nov 25, 2019
9fa6982
pdf uploaded, hw9 done
Mushaddict Nov 25, 2019
52aa005
file uploaded
Mushaddict Nov 26, 2019
ed4d45b
ply files uploaded
Mushaddict Nov 27, 2019
e6d0da7
python file uploaded
Mushaddict Dec 2, 2019
cb4d13f
picture uploaded
Mushaddict Dec 2, 2019
4dcdd10
html uploaded--unfinished
Mushaddict Dec 2, 2019
ca65d84
PDF uploaded
Mushaddict Dec 2, 2019
6356a26
uploads
Mushaddict Dec 2, 2019
e5cfbc9
code starts here
Mushaddict Dec 2, 2019
6498266
README.MD updates
Mushaddict Dec 6, 2019
2c79b13
background upload
Mushaddict Dec 6, 2019
a7acc29
working on it
Mushaddict Dec 8, 2019
ed0b04c
upate xtk layer1
Mushaddict Dec 8, 2019
ed53964
900x600
Mushaddict Dec 8, 2019
f7c97cb
20x20 pixels
Mushaddict Dec 8, 2019
1bfa8ac
20 x 10 pixels
Mushaddict Dec 8, 2019
6deb1f2
15 x 10 pixels
Mushaddict Dec 8, 2019
3873ad7
test for layer2
Mushaddict Dec 8, 2019
392384f
test
Mushaddict Dec 8, 2019
a8de347
test for 3D layer
Mushaddict Dec 8, 2019
f3cd8f4
update renderer()
Mushaddict Dec 8, 2019
b36e7fb
update
Mushaddict Dec 8, 2019
c45aff1
极端测试
Mushaddict Dec 8, 2019
1224283
test
Mushaddict Dec 8, 2019
f92cd03
render() update
Mushaddict Dec 8, 2019
1994f43
1000 pixels test
Mushaddict Dec 8, 2019
d2ff4f5
1000 test
Mushaddict Dec 8, 2019
0117be0
style change
Mushaddict Dec 8, 2019
7a46fa2
index update (update undefined)
Mushaddict Dec 9, 2019
6eb50c2
controls update
Mushaddict Dec 12, 2019
5ef0652
two layers
Mushaddict Dec 12, 2019
2979dd2
canvas upload
Mushaddict Dec 13, 2019
80a251c
picture upload
Mushaddict Dec 13, 2019
0d47fc6
Merge branch 'master' of https://github.com/Mushaddict/cs460student
Mushaddict Dec 13, 2019
6fb2321
color change
Mushaddict Dec 13, 2019
989a8db
xtklayer
Mushaddict Dec 13, 2019
2db3a9e
failed work
Mushaddict Dec 15, 2019
d57fbee
split the picture
Mushaddict Dec 17, 2019
374723d
not working, don't know why
Mushaddict Dec 17, 2019
6dd9f24
split the picture
Mushaddict Dec 17, 2019
bb576bc
xtk not working
Mushaddict Dec 17, 2019
0d81285
worked
Mushaddict Dec 18, 2019
ed9784a
readme update
Mushaddict Dec 18, 2019
5899a57
mountains upload
Mushaddict Dec 20, 2019
e2eff72
cubes onloading
Mushaddict Dec 20, 2019
a79a18b
some tryings
Mushaddict Dec 20, 2019
d1cb707
final project rendering
Mushaddict Dec 20, 2019
71e72f3
final updated
Mushaddict Dec 21, 2019
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 01/CS460_Assignment_01__Copy_.pdf
Binary file not shown.
Binary file added 02/CS460_Assignment_02__Copy_.pdf
Binary file not shown.
102 changes: 102 additions & 0 deletions 02/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!-- <!DOCTYPE html> -->
<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;
padding: 0;
height: 100%;
overflow: hidden !important;
}

#logo {
position: absolute;
right: 10px;
top: 10px;
}
</style>
<!-- everything comes from goXTK.com -->
<script type="text/javascript" src="https://get.goXTK.com/xtk_edge.js"></script>

<script type = "text/javascript">

window.onload = function(){

//create and initialize a 3D render
r = new X.renderer3D();
r.init();

//create a 9X9 pixels
for (var i = 0; i < 9; i++){
for (var j = 0; j < 9; j++){

//create a new cube
var cube = new X.cube();
cube.center = [i * 3, j * 3, 1];
cube.lengthX = cube.lengthY = cube.lengthZ = 2;

//set colors;
cube.color = [0, 1, 0];
if((i == 0 && j == 0) ||
(i == 0 && j == 1) ||
(i == 0 && j == 2) ||
(i == 0 && j == 3) ||
(i == 0 && j == 5) ||
(i == 0 && j == 6) ||
(i == 0 && j == 7) ||
(i == 0 && j == 8) ||
(i == 1 && j == 0) ||
(i == 1 && j == 1) ||
(i == 1 && j == 2) ||
(i == 1 && j == 6) ||
(i == 1 && j == 7) ||
(i == 1 && j == 8) ||
(i == 2 && j == 0) ||
(i == 2 && j == 1) ||
(i == 2 && j == 2) ||
(i == 2 && j == 6) ||
(i == 2 && j == 7) ||
(i == 2 && j == 8) ||
(i == 3 && j == 0) ||
(i == 3 && j == 8) ||
(i == 4 && j == 0) ||
(i == 4 && j == 8) ||
(i == 7 && j == 0) ||
(i == 7 && j == 1) ||
(i == 7 && j == 2) ||
(i == 7 && j == 6) ||
(i == 7 && j == 7) ||
(i == 7 && j == 8) ||
(i == 8 && j == 0) ||
(i == 8 && j == 1) ||
(i == 8 && j == 2) ||
(i == 8 && j == 6) ||
(i == 8 && j == 7) ||
(i == 8 && j == 8) ){
cube.color = [0, 0, 0];
}

//add it
r.add(cube);

// r.onRender = function(){
// r.camera.rotate([1, 1]);
// }
}
}
r.render();

}

</script>
</head>
<body>
<h1>CS460 Assignment 2</h1>
<div id="logo"><img style="height:60px" src="gfx/cs460.png"></div>
</body>
</html>
118 changes: 118 additions & 0 deletions 02/try.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!-- <!DOCTYPE html> -->
<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;
padding: 0;
height: 100%;
overflow: hidden !important;
}

#logo {
position: absolute;
right: 10px;
top: 10px;
}
</style>
<!-- everything comes from goXTK.com -->
<script type="text/javascript" src="https://get.goXTK.com/xtk_edge.js"></script>

<script type = "text/javascript">

var items = [[0, 0, 0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 0],
[0, 1, 1, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1],
[0, 0, 0, 1, 1, 1, 0, 0, 0],
[0, 0, 0, 1, 1, 1, 0, 0, 0]];
window.onload = function(){

//create and initialize a 3D render
r = new X.renderer3D();
r.init();

var i = 0;
var j = 0;
for (i; i < items.length; i++) {
for (j = 0; j < items[0].length; j++){

cube = new X.cube();
cube.center = [i * 3, j * 3, 1];
cube.color = [1, 1, 1];
cube.lengthX = cube.lengthY = cube.lengthZ = 2;

if(items[i][j] == 0){
cube.color = [0, 0, 0];
}
if(items[i][j] == 1){
cube.color = [0, 1, 0];
}

r.add(cube);

//set camera further away
r.camera.position[0, 0, 1000];

r.render();
}
}
// r.add(cube);
// r.render();
setInterval(function(){

items[0][4] = 2;
items[2][3] = 2;
items[2][5] = 2;
items[4][1] = 2;
items[4][4] = 2;
items[4][7] = 2;
items[6][2] = 2;
items[6][4] = 2;
items[6][6] = 2;

for (i = 0; i < items.length; i++){
for (j = 0; j < items[0].length; j++){
cube = new X.cube();
cube.center = [i * 3, j * 3, 1];
cube.color = [1, 1, 1];
cube.lengthX = cube.lengthY = cube.lengthZ = 2;

if(items[i][j] == 0){
cube.color = [0, 0, 0];
}
if(items[i][j] == 1){
cube.color = [0, 1, 0];
}
if(items[i][j] == 2){
cube.color = [1, 0, 0];
}

r.add(cube);

//set camera further away
r.camera.position[0, 0, 1000];

r.render();
}
}

}, 1000);

}

</script>
</head>
<body>
<h1>CS460 Assignment 2</h1>
<div id="logo"><img style="height:60px" src="gfx/cs460.png"></div>
</body>
</html>
Binary file added 03/CS460_Assignment_03__Copy_.pdf
Binary file not shown.
73 changes: 73 additions & 0 deletions 03/class.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<html>
<head>
<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>
window.onload = function() {


// Three.js code goes here
scene = new THREE.Scene();

fov = 75;
ratio = window.innerWidth / window.innerHeight;
zNear = 1;
zFar = 10000;

camera = new THREE.PerspectiveCamera(fov, ratio, zNear, zFar);
camera.position.set(0, 0, 100);

renderer = new THREE.WebGLRenderer();
renderer.setSize(
window.innerWidth,
window.innerHeight
);
document.body.appendChild(renderer.domElement);

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

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

//now we add the cube
geometry = new THREE.BoxBufferGeometry(20, 20, 20);
material = new THREE.MeshStandardMaterial({color: 0xffffff});
cube = new THREE.Mesh(geometry, material);
scene.add(cube);

controls = new THREE.TrackballControls(camera);

animate();


function animate(){

requestAnimationFrame(animate);
controls.update();
renderer.render(scene, camera);
};

};

function animate() {

requestAnimationFrame( animate );

// and here...

};
</script>
</head>
<body></body>
</html>
92 changes: 92 additions & 0 deletions 03/geometry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<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>
window.onload = function() {

scene = new THREE.Scene();

camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.set( 0, 0, 100 );

renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

renderer.domElement.onclick = function( e ){

if(!e.keyShift){
e.preventDefault();
return false;
}

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

vp_coords = new THREE.Vector2((pixel_coords.x/window.innerWidth) * 2 -1, //X
-(pixel_coords.y/window.innerHeight) * 2 + 1); //Y
console.log('Viewport coords', vp_coords);

vp_coords_near = new THREE.Vector3(vp_coords.x, vp_coords.y, 0);
console.log(vp_coords_near);

raycaster = new THREE.Raycaster();
raycaster.setFromCamera(vp_coords_near, camera);
intersects = raycaster.intersectObject(invisible_plane);
first_intersection = intersects[0];
console.log(first_intersection);

//move the cube to new 3d position
//cube.position.set(first_intersection.point.x, first_intersection.point.y, first_intersection.point.z);
};

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

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

geometry = new THREE.BoxBufferGeometry( 20, 20, 20 );
material = new THREE.MeshStandardMaterial({ color: 0xffffff });
cube = new THREE.Mesh( geometry, material );
scene.add(cube);

geometry = new THREE.PlaneBufferGeometry(10000, 10000);
material = new THREE.MeshStandardMaterial({
visible: false
});
invisible_plane = new THREE.Mesh(geometry, material);

scene.add(invisible_plane);

controls = new THREE.TrackballControls( camera );

animate();

};

function animate() {

requestAnimationFrame( animate );

controls.update();
renderer.render( scene, camera );

};
</script>
</head>
<body></body>
</html>
Binary file added 03/gfx/WechatIMG6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading