-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTP3_C1_Segments.html
37 lines (35 loc) · 1.21 KB
/
TP3_C1_Segments.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Assignment 3 - C1</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="js/parallel.js"></script>
<script src="js/three.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/BufferGeometryUtils.js"></script>
<script src="TP3_Data.js"></script>
<script src="TP3_Geometry.js"></script>
<script src="TP3_Render.js"></script>
<script src="TP3_Lindenmayer.js"></script>
<script src="js/MainInit.js"></script>
<script>
camera.position.y = 2;
camera.position.z = 3;
controls.target.y = 2;
controls.update();
const data = TP3.Data.SmallTree;
const iters = 5;
const lengthDivisions = 4;
const radialDivisions = 5;
//console.log(TP3.Geometry.hermite(2,5,1,-1,0.5));
const grammar = TP3.Lindenmayer.iterateGrammar(data.str, data.dict, iters);
const nodeTree = TP3.Geometry.generateSkeleton(grammar, data.theta, data.alpha, data.decay);
TP3.Geometry.simplifySkeleton(nodeTree);
TP3.Geometry.generateSegmentsHermite(nodeTree, lengthDivisions, radialDivisions);
TP3.Render.drawTreeSegments(nodeTree, scene);
</script>
</body>
</html>