Skip to content

Accept either a w coordinate component or an RGB color for vertices#78

Open
SwishSwushPow wants to merge 1 commit into
Twinklebear:masterfrom
GiGainfosystems:fix_parsing_of_w_component
Open

Accept either a w coordinate component or an RGB color for vertices#78
SwishSwushPow wants to merge 1 commit into
Twinklebear:masterfrom
GiGainfosystems:fix_parsing_of_w_component

Conversation

@SwishSwushPow

Copy link
Copy Markdown
Contributor

This fixes an issue where it was not possible to parse obj files that provide a w-component with their vertex coordinates. Vertices can now come with a w-component OR RGB colors. I went with this route because of the information that can be found on the Wavefront .obj Wikipedia page.

A vertex is specified via a line starting with the letter v. That is followed by (x,y,z[,w]) coordinates. W is optional and defaults to 1.0. W scales the point. The point (x,y,z,w) corresponds to the point (x/w,y/w,z/w). A right-hand coordinate system is used to specify the coordinate locations. Some applications support vertex colors, by putting red, green and blue values after x y and z (this precludes specifying w). The color values range from 0 to 1.

Also added new tests for these cases.

Also added two new tests for these cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant