|
@@ -1,6 +1,7 @@
|
|
import {
|
|
import {
|
|
BufferAttribute,
|
|
BufferAttribute,
|
|
BufferGeometry,
|
|
BufferGeometry,
|
|
|
|
+ Color,
|
|
DoubleSide,
|
|
DoubleSide,
|
|
FileLoader,
|
|
FileLoader,
|
|
Group,
|
|
Group,
|
|
@@ -182,6 +183,8 @@ class StrokeGeometry extends BufferGeometry {
|
|
const vector3 = new Vector3();
|
|
const vector3 = new Vector3();
|
|
const vector4 = new Vector3();
|
|
const vector4 = new Vector3();
|
|
|
|
|
|
|
|
+ const color = new Color();
|
|
|
|
+
|
|
// size = size / 2;
|
|
// size = size / 2;
|
|
|
|
|
|
for ( const k in strokes ) {
|
|
for ( const k in strokes ) {
|
|
@@ -190,7 +193,10 @@ class StrokeGeometry extends BufferGeometry {
|
|
const positions = stroke[ 0 ];
|
|
const positions = stroke[ 0 ];
|
|
const quaternions = stroke[ 1 ];
|
|
const quaternions = stroke[ 1 ];
|
|
const size = stroke[ 2 ];
|
|
const size = stroke[ 2 ];
|
|
- const color = stroke[ 3 ];
|
|
|
|
|
|
+ const rgba = stroke[ 3 ];
|
|
|
|
+ const alpha = stroke[ 3 ][ 3 ];
|
|
|
|
+
|
|
|
|
+ color.fromArray( rgba ).convertSRGBToLinear();
|
|
|
|
|
|
prevPosition.fromArray( positions, 0 );
|
|
prevPosition.fromArray( positions, 0 );
|
|
prevQuaternion.fromArray( quaternions, 0 );
|
|
prevQuaternion.fromArray( quaternions, 0 );
|
|
@@ -227,13 +233,13 @@ class StrokeGeometry extends BufferGeometry {
|
|
prevPosition.copy( position );
|
|
prevPosition.copy( position );
|
|
prevQuaternion.copy( quaternion );
|
|
prevQuaternion.copy( quaternion );
|
|
|
|
|
|
- colors.push( ...color );
|
|
|
|
- colors.push( ...color );
|
|
|
|
- colors.push( ...color );
|
|
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
|
|
- colors.push( ...color );
|
|
|
|
- colors.push( ...color );
|
|
|
|
- colors.push( ...color );
|
|
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
+ colors.push( ...color, alpha );
|
|
|
|
|
|
const p1 = i / l;
|
|
const p1 = i / l;
|
|
const p2 = ( i - 3 ) / l;
|
|
const p2 = ( i - 3 ) / l;
|