-
Notifications
You must be signed in to change notification settings - Fork 106
/
surfaceAdaptiveTessellation.html
52 lines (40 loc) · 1.86 KB
/
surfaceAdaptiveTessellation.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<title>Adaptive surface tessellation</title>
<script src="js/verb.min.js"></script>
<script src="js/three.min.js"></script>
<script src="js/verbToThreeConversion.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/codemirror.js"></script>
<script src="js/javascript.js"></script>
<script src="js/threeBasic.js"></script>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/codemirror.css">
<link rel="stylesheet" href="css/example.css">
<link rel="stylesheet" href="css/colorforth.css">
</head>
<body>
<div id="button">Show/Hide Code</div>
<div id="viewer" class="col">
<div id="title"></div>
</div>
<div id="code-container" class="col scroll-y"></div>
</body>
<script id="script">
setupScene();
var degree = 3
, knots = [0, 0, 0, 0, 0.333, 0.666, 1, 1, 1, 1]
, pts = [ [ [0, 0, -10], [10, 0, 0], [20, 0, 0], [30, 0, 0] , [40, 0, 0], [50, 0, 0] ],
[ [0, -10, 0], [10, -10, 10], [20, -10, 10], [30, -10, 0] , [40, -10, 0], [50, -10, 0] ],
[ [0, -20, 0], [10, -20, 10], [20, -20, 10], [30, -20, 0] , [40, -20, -2], [50, -20, -12] ],
[ [0, -30, 0], [10, -30, 0], [20, -30, -23], [30, -30, 0] , [40, -30, 0], [50, -30, 0] ],
[ [0, -40, 0], [10, -40, 0], [20, -40, 0], [30, -40, 4] , [40, -40, -20], [50, -40, 0] ],
[ [0, -50, 12], [10, -50, 0], [20, -50, 20], [30, -50, 0] , [50, -50, -10], [50, -50, -15] ], ];
var srf = verb.geom.NurbsSurface.byKnotsControlPointsWeights( degree, degree, knots, knots, pts );
var mat = new THREE.MeshBasicMaterial( { color: 0xffffff, side: THREE.DoubleSide, wireframe: true });
addMeshToScene( srf.toThreeGeometry(), mat );
renderScene();
</script>
<script src="js/example.js"></script>
</html>