PyAssimp - How to interpret the material values? #4192
-
|
I'm wondering how I am supposed to interpret the data I receive in the "materials" array? I'm loading a Wavefront (.obj + .mtl) file and the diffuse and specular properties which I expected to be a set of 3 floats are all single integers. I saw a code example somewhere in this repository (here) which seemed to suggest that this was the expected output (a single integer) but I am no closer to understanding what to do with it. Snippet from the .mtl file: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You can just set the value ka for the ambient color of the material. Kd stands for the diffuse color and Ks for the specular color. |
Beta Was this translation helpful? Give feedback.
-
|
All data in a material is stored as a parameter. So if you want to see what kind of data is stored in your material-instance I strongly recommend to study our samples, like: So you can reach each data-item like the diffuce color by its key and the value contains the data assigned to this. As far as I know colors are stored as Color3D, which looks like: So if I get the sample right you shall be able to access all the components by using r, g, b |
Beta Was this translation helpful? Give feedback.

All data in a material is stored as a parameter. So if you want to see what kind of data is stored in your material-instance I strongly recommend to study our samples, like:
So you can reach each data-item like the diffuce color by its key and the value contains the data assigned to this. As far as I know colors are stored as Color3D, which looks like: