Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions examples/jsm/loaders/OBJLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
MeshPhongMaterial,
Points,
PointsMaterial,
Vector3
Vector3,
Color
} from 'three';

// o object_name | g group_name
Expand All @@ -30,6 +31,8 @@ const _vC = new Vector3();
const _ab = new Vector3();
const _cb = new Vector3();

const _color = new Color();

function ParserState() {

const state = {
Expand Down Expand Up @@ -536,12 +539,13 @@ class OBJLoader extends Loader {
);
if ( data.length >= 7 ) {

state.colors.push(
_color.setRGB(
parseFloat( data[ 4 ] ),
parseFloat( data[ 5 ] ),
parseFloat( data[ 6 ] )
).convertSRGBToLinear();

);
state.colors.push( _color.r, _color.g, _color.b );

} else {

Expand Down