-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththreejslinerendertest.html
59 lines (51 loc) · 1.92 KB
/
threejslinerendertest.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
53
54
55
56
57
58
59
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=no'>
<meta name='mobile-web-app-capable' content='yes'>
<meta name='apple-mobile-web-app-capable' content='yes'>
<link rel='icon' type='image/png' sizes='32x32' href='favicon-32x32.png'>
<link rel='icon' type='image/png' sizes='96x96' href='favicon-96x96.png'>
<link rel='stylesheet' href='css/common.css'>
<title>three.js line renderer test</title>
</head>
<body>
<header>
<details open>
<summary>Three.js Line Renderer</summary>
<p>
;lksajdf;oaj
<a class="back" href="./">Back</a>
</p>
</details>
</header>
<script type="module">
import * as THREE from './js/third-party/three.js/build/three.module.js';
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 500 );
camera.position.set( 0, 0, 100 );
camera.lookAt( 0, 0, 0 );
var scene = new THREE.Scene();
// var material = new THREE.LineDashedMaterial( { color: 0xffffff, } ); // green
var material = new THREE.LineDashedMaterial( {
color: 0xffffff
// linewidth: 50,
// scale: 1,
// dashSize: .01,
// gapSize: .1,
});
var points = [];
points.push( new THREE.Vector3( - 10, 0, 0 ) );
// points.push( new THREE.Vector3( 0, 10, 0 ) );
points.push( new THREE.Vector3( 10, 0, 0 ) );
var geometry = new THREE.BufferGeometry().setFromPoints( points );
var line = new THREE.Line( geometry, material );
scene.add( line );
renderer.render( scene, camera );
console.log("hello world");
</script>
</body>
</html>