Open agorgl opened 3 years ago
I assume the desired output is:
floor: 1
ceiling: 1
backWall: 1
rightWall: 1
leftWall: 1
shortBox: 6
tallBox: 6
light: 1
It seems that the problem then is that the cornell box obj file has multiple "usemtl" calls with the same name. It's not clear what the right behaviour is then. From the spec I believe calling usemtl specifies the material name for the element following it, so doing something like:
usemtl shortBox
f ...
f ...
...
f ...
g shortBox
usemtl shortBox
usemtl tallBox
should in theory create a second empty group set to material shortBox
because of the second usemtl shortBox
command.
I think there are two sane options here:
usemtl shortBox
command is wiped by the following usemtl tallBox
command) orI think either of the options would parse the cornell box in the way we expect above,
The other problem with that file is that the g
command is sometimes after the faces are determined, which doesn't follow the obj spec, but suggests that we should treat usemtl
as setting a new group (which I think we've been doing already).
Any suggestions?
No suggestions from me.
Using
CornellBox-Original.obj
from https://casual-effects.com/data/ the following snippet:shows: