LSDView icon indicating copy to clipboard operation
LSDView copied to clipboard

Support vertex colours for OBJ exports

Open figglewatts opened this issue 3 years ago • 0 comments

It may be possible to support vertex colours for OBJ exports, per: http://paulbourke.net/dataformats/obj/colour.html

The formal OBJ format specification does not include the opportunity to have per-vertex colour, only a per face colour through the MTL file standard. The usual approach of specifying vertex colour is to add the colour components, RGB as floating point values between 0 and 1, at the end of each vertex line. This does not break existing OBJ readers which are supposed to operate on a line by line basis and vertex colours defined in this way are widely supported. If a vertex line contains 3 values then they are interpretted as (x,y,z), if there are 4 values then they correspond to (x,y,z,w), if there are 6 values then they correspond to (x,y,z,r,g,b). So, for example a red vertex might be:

v 0.5 0.5 0.5 1.0 0.0 0.0

figglewatts avatar Sep 26 '21 17:09 figglewatts