-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion on sub-objects and materials #89
Comments
@NumaNumaNuma Thanks for the report. Is this happening with the latest version of the javascript decoder? Just checking, because last week we have fixed some issues with UV decoding that may be related to the problem that you are experiencing. |
I'm 2 commits behind I think, is this the one you're talking about: |
Yes, that's the one that fixed the issue for other users |
I'll pull and check |
It looks different but still not right (assuming my code is correct?) |
Can you post your code for generating |
I think 'k' is ok, it's incremented once while 'i' is incremented 3 times it's basically i/3. points/normals/faces all map correctly. Here is the code:
|
I have emailed you the files. thanks! |
Ok I found the problem, your latest patch DID fix it. The engine I'm using has inverted Y coordinates, so I had to flip the second UV value and it's all good now. thanks very much! |
@NumaNumaNuma Thanks for the update. Good to know! |
@NumaNumaNuma |
@openforus Sub object attribute are automatically created when encoding .obj files that define object groups using |
thanks I find the example in draco_encoder problem #67
At 2017-04-06 00:45:06, "Ondrej Stava" <notifications@github.com> wrote:
@openforus Sub object attribute are automatically created when encoding .obj files that define object groups using o property. More details how to get the attribute can be found for example here: #67 (comment)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi ondys NumaNumaNuma, |
@openforus I believe it's actually supported only for triangular meshes (not point clouds). To add indices for sub-objects above you can for example add one extra loop before the
then you allocate indices for each subobject: replace
lastly you add one more loop at the end where you fill the indices as:
|
@ondys thaks ondys ,I will try later ! Thanks again for your help! |
@NumaNumaNuma @ondys
Changing the subsequent code accordingly. But the issue occurs when the same sub-object have same material repeated twice in .obj file (For ex; the one in the link). So can you suggest what can be done to include that case (Though these may not occur very frequently)? |
Hi, I’m little bit confused when I try to decode models materialAttrId and subObjAttId return always -1. For shubhamagarwal003’s ex (you add extra 'a' at the end of your link) if I encode it with command
I have:
And same size without --metadata tag @shubhamagarwal003 can you share me your DracoLoader code please? |
@shubhamagarwal003 I believe there is a bug in Draco obj loader with repeated materials in one obj files that should be fixed in our next release @JackC09 Thanks for the report, I'll investigate |
@shubhamagarwal003 I use the latest commit. |
@JackC09 I've done changes in DracoLoader.js in the repo. Mostly in function convertDracoGeometryTo3JS. Here is my modified function (Sorry for the code quality).
I've another function setMaterials in which I set the materials loaded from Mtl-Loader.
|
@shubhamagarwal003 thanks it's really useful for me. @ondys by placing --metadata flag before like this
result is better with shubhamagarwal003's model:
Now I have subObjAttId but materialAttrId still return -1 |
@JackC09 Yes there was a bug in Draco when --metadata was the last argument passed in (in which case it was ignored). It's fixed now in our private repo and we will push the fix to public in the coming days. I'll look into the issue with materialAttrId == -1 |
@ondys Hi, I tried the latest commit 1.1.0 and for some models materialAttrId was ok but subObjAttId == -1 In the description it is written 'Draco can preserve material or sub-object names' how can I get the subObjName? |
Which of the shared model had the problem with subObjAttId ? Note that subobject ids are currently generated only when the obj uses "o " keyword. When the .obj is encoded with |
@ondys where map between sub-object ids and the corresponding sub object names? |
@PumpkinDev In c++ you can see an example in |
Do we have any programmatic way of loading a .drc file that has several textures? I have a large model ( I am thinking of writing a parser to separate the OBJ into several sub OBJs to reference each materials file individually, but perhaps we already have a working version of something similar (or better) than this approach? |
Hi,
I'm bringing in an obj model with sub-objects. the suObjectAttribute works fine to assign points back to the correct sub-objects, but uv's don't come out properly. here's what I'm doing:
result:
https://puu.sh/v58lD/bf2c2363d9.png
thanks
The text was updated successfully, but these errors were encountered: