Comments (2)
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:
- Don't parse empty groups (second
usemtl shortBox
command is wiped by the followingusemtl tallBox
command) or - Ignore subsequent usemtl commands with the same name.
I 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?
from obj.
No suggestions from me.
from obj.
Related Issues (16)
- Use an external parser HOT 4
- Expose `mint` types
- Export support HOT 1
- Removing Panics On Failed Parse HOT 2
- Question: how to avoid duplicating material data if multiple objects/groups link to the same material? HOT 4
- Release v0.10 HOT 3
- Switch to Github actions
- Bump to 0.10.1 HOT 2
- Decouple obj/mtl parsing from IO HOT 4
- Release 0.10.2? HOT 1
- MSRV 1.37.0 -> 1.40.0 in 0.10.2 HOT 1
- Test failed in copr HOT 1
- Tangents and bitangents calculation.
- Support for edges and points
- Material assignment issue for groups declared after `usemtl` directive HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obj.