Comments (8)
I quickly made a file in Wings3D – this is an all quad model. Feel free to use however you want.
from obj-rs.
Hi @virtualritz! Thanks for using obj-rs and giving me a good idea!
obj-rs have two types. One is obj_rs::raw::RawObj
. RawObj
is one-to-one mapping of Wavefront OBJ types and Rust. And the other is obj_rs::Obj
. Obj
is transformed RawObj
so that can be easily rendered to screen with OpenGL, Direct3D, Metal, or Vulkan.
I may have not tested all corner cases but AFAIK RawObj
does support n-gons. And Obj
cannot support n-gons since it's a format which should be rendered directly to the screen.
Maybe I can make some "n-gon Mesh to triangle Mesh" transformer as a separate crate but looks like it's not a trivial work.
About higher order surfaces... yes you are right. They are part of the spec of Wavefront OBJ and obj-rs currently do not support it. I definitely need to implement it.
from obj-rs.
TLDR;
If the crate is this specific, make it apparent in the description so people don't waste time with it when they need other features.
I would suggest to rename Obj
to ObjAsTriangles
or something like this to make it apparent that this is triangles only. Because this is not apparent. Nowhere in your crate description does it say "This crate is for reading OBJs for rendering on screen – if the object is not made out of triangles it can not be read."
This is a new problem btw. If you had any library to read OBJs 10-20 years ago, it would always read the data as-is. I btw. predict that soon graphics cards will support subdivision surfaces. And then all the tools have to support quads and n-gons anyway. :)
RawObj
seems to have what I need but then I have to write another bunch of code on top to get the data extracted nicely from that. It would still be great to have a simple API as the current one which does not convert to triangles and gives you an vertices_per_face
vector/array.
from obj-rs.
At them moment I use the tobj
crate. It has the same problem but it does read n-gons and converts them on the fly. Not ideal for me but I don't have to write code at least. :P
This is what I am using this for: https://github.com/virtualritz/rust-diffusion-limited-aggregation
If obj-rs
ever supports n-gons I will switch to your crate.
from obj-rs.
I've changed the title to make this issue more clear! Thanks for your comment :)
from obj-rs.
Cool. If you support higher order surfaces, your lib will be outstanding. The only DCC apps that can read & write OBJs with NURBS or patches are Rhino3D and Maya, afaik.
from obj-rs.
Oh, and Blender, apparently!
from obj-rs.
5 years ago, I thought that hiding the low level RawObj
type and presenting Obj
type in the front page would be better. Since I thought that no one will want to mess around with the details of Obj type.
But now, I think it would be better to show the RawObj type to the front, and to show the Obj types separately as a helper. Wavefront OBJ is too complex format and there are so many corner cases that can't be abstracted with simple Obj
type. And anyway, it's almost impossible to fully abstract the Wavefront OBJ type because of the MTL specification.
How do you think?
from obj-rs.
Related Issues (20)
- Drop rustc-serialize dependency HOT 1
- Texture Coordinates HOT 1
- u32 indices HOT 4
- Panic on attempt to subtract with overflow
- High level abstraction of material specifiction HOT 4
- Document how to use and customize `Obj` in detail HOT 5
- the trait `glium::Vertex` is not implemented for `obj::TexturedVertex` HOT 7
- Are materials going to be supported? HOT 3
- Are there any plans to support writing HOT 1
- CI 'sampleapp-volkano' HOT 1
- Get replicated vertices when reading obj HOT 6
- Some OBJ specifications are not implemented yet HOT 1
- thread 'main' panicked at 'capacity overflow' HOT 3
- Update example for newer versions/editions of rust? HOT 1
- Better support for custom vertex formats HOT 1
- Contain code that will be rejected by a future version of Rust HOT 5
- Should load_obj panic on indicies that exceed the bounds of I HOT 1
- Seemingly no way to use include_bytes! for a file HOT 2
- Load larger models HOT 1
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-rs.