File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ import {
1111 MeshPhongMaterial ,
1212 Points ,
1313 PointsMaterial ,
14- Vector3
14+ Vector3 ,
15+ Color
1516} from 'three' ;
1617
1718// o object_name | g group_name
@@ -30,6 +31,8 @@ const _vC = new Vector3();
3031const _ab = new Vector3 ( ) ;
3132const _cb = new Vector3 ( ) ;
3233
34+ const _color = new Color ( ) ;
35+
3336function ParserState ( ) {
3437
3538 const state = {
@@ -536,12 +539,13 @@ class OBJLoader extends Loader {
536539 ) ;
537540 if ( data . length >= 7 ) {
538541
539- state . colors . push (
542+ _color . setRGB (
540543 parseFloat ( data [ 4 ] ) ,
541544 parseFloat ( data [ 5 ] ) ,
542545 parseFloat ( data [ 6 ] )
546+ ) . convertSRGBToLinear ( ) ;
543547
544- ) ;
548+ state . colors . push ( _color . r , _color . g , _color . b ) ;
545549
546550 } else {
547551
You can’t perform that action at this time.
0 commit comments