@@ -10,7 +10,7 @@ const app = new WHS.App([
10
10
controlsModule
11
11
] ) ;
12
12
13
- controlsModule . controls . autoRotate = true ;
13
+ // controlsModule.controls.autoRotate = true;
14
14
15
15
const yPadding = 2 ;
16
16
const xzPadding = 1 ;
@@ -36,10 +36,12 @@ function drawRectangle(points, color) {
36
36
// join the bottom points
37
37
for ( let i = 0 ; i < points . length - 1 ; i ++ ) {
38
38
const line = new WHS . Line ( {
39
- geometry : {
40
- start : new THREE . Vector3 ( points [ i ] . x , points [ i ] . y , points [ i ] . z ) ,
41
- end : new THREE . Vector3 ( points [ i + 1 ] . x , points [ i + 1 ] . y , points [ i + 1 ] . z )
42
- } ,
39
+ curve : new THREE . LineCurve3 (
40
+ new THREE . Vector3 ( points [ i ] . x , points [ i ] . y , points [ i ] . z ) ,
41
+ new THREE . Vector3 ( points [ i + 1 ] . x , points [ i + 1 ] . y , points [ i + 1 ] . z )
42
+ ) ,
43
+
44
+ points : 2 ,
43
45
44
46
material : new THREE . LineBasicMaterial ( {
45
47
color
@@ -52,10 +54,12 @@ function drawRectangle(points, color) {
52
54
// top square
53
55
for ( let i = 0 ; i < points . length - 1 ; i ++ ) {
54
56
const line = new WHS . Line ( {
55
- geometry : {
56
- start : new THREE . Vector3 ( points [ i ] . x , points [ i ] . y + yDist , points [ i ] . z ) ,
57
- end : new THREE . Vector3 ( points [ i + 1 ] . x , points [ i + 1 ] . y + yDist , points [ i + 1 ] . z )
58
- } ,
57
+ curve : new THREE . LineCurve3 (
58
+ new THREE . Vector3 ( points [ i ] . x , points [ i ] . y + yDist , points [ i ] . z ) ,
59
+ new THREE . Vector3 ( points [ i + 1 ] . x , points [ i + 1 ] . y + yDist , points [ i + 1 ] . z )
60
+ ) ,
61
+
62
+ points : 2 ,
59
63
60
64
material : new THREE . LineBasicMaterial ( {
61
65
color
@@ -67,17 +71,19 @@ function drawRectangle(points, color) {
67
71
68
72
// closes the top square
69
73
const line2 = new WHS . Line ( {
70
- geometry : {
71
- start : new THREE . Vector3 (
74
+ curve : new THREE . LineCurve3 (
75
+ new THREE . Vector3 (
72
76
points [ points . length - 1 ] . x ,
73
77
points [ points . length - 1 ] . y + yDist ,
74
78
points [ points . length - 1 ] . z ) ,
75
79
76
- end : new THREE . Vector3 (
80
+ new THREE . Vector3 (
77
81
points [ 0 ] . x ,
78
82
points [ 0 ] . y + yDist ,
79
83
points [ 0 ] . z )
80
- } ,
84
+ ) ,
85
+
86
+ points : 2 ,
81
87
82
88
material : new THREE . LineBasicMaterial ( {
83
89
color
@@ -87,10 +93,12 @@ function drawRectangle(points, color) {
87
93
88
94
// closes the bottom square
89
95
const line = new WHS . Line ( {
90
- geometry : {
91
- start : new THREE . Vector3 ( points [ points . length - 1 ] . x , points [ points . length - 1 ] . y , points [ points . length - 1 ] . z ) ,
92
- end : new THREE . Vector3 ( points [ 0 ] . x , points [ 0 ] . y , points [ 0 ] . z )
93
- } ,
96
+ curve : new THREE . LineCurve3 (
97
+ new THREE . Vector3 ( points [ points . length - 1 ] . x , points [ points . length - 1 ] . y , points [ points . length - 1 ] . z ) ,
98
+ new THREE . Vector3 ( points [ 0 ] . x , points [ 0 ] . y , points [ 0 ] . z )
99
+ ) ,
100
+
101
+ points : 2 ,
94
102
95
103
material : new THREE . LineBasicMaterial ( {
96
104
color
@@ -101,10 +109,12 @@ function drawRectangle(points, color) {
101
109
// vertical join
102
110
for ( let i = 0 ; i < points . length - 1 ; i ++ ) {
103
111
const line = new WHS . Line ( {
104
- geometry : {
105
- start : new THREE . Vector3 ( points [ i ] . x , points [ i ] . y , points [ i ] . z ) ,
106
- end : new THREE . Vector3 ( points [ i ] . x , points [ i + 1 ] . y + yDist , points [ i ] . z )
107
- } ,
112
+ curve : new THREE . LineCurve3 (
113
+ new THREE . Vector3 ( points [ i ] . x , points [ i ] . y , points [ i ] . z ) ,
114
+ new THREE . Vector3 ( points [ i ] . x , points [ i + 1 ] . y + yDist , points [ i ] . z )
115
+ ) ,
116
+
117
+ points : 2 ,
108
118
109
119
material : new THREE . LineBasicMaterial ( {
110
120
color
@@ -115,10 +125,12 @@ function drawRectangle(points, color) {
115
125
}
116
126
// closes the vertical one
117
127
const line3 = new WHS . Line ( {
118
- geometry : {
119
- start : new THREE . Vector3 ( points [ points . length - 1 ] . x , points [ points . length - 1 ] . y , points [ points . length - 1 ] . z ) ,
120
- end : new THREE . Vector3 ( points [ 3 ] . x , points [ 3 ] . y + yDist , points [ 3 ] . z )
121
- } ,
128
+ curve : new THREE . LineCurve3 (
129
+ new THREE . Vector3 ( points [ points . length - 1 ] . x , points [ points . length - 1 ] . y , points [ points . length - 1 ] . z ) ,
130
+ new THREE . Vector3 ( points [ 3 ] . x , points [ 3 ] . y + yDist , points [ 3 ] . z )
131
+ ) ,
132
+
133
+ points : 2 ,
122
134
123
135
material : new THREE . LineBasicMaterial ( {
124
136
color
0 commit comments