Open GoogleCodeExporter opened 9 years ago
Per-vertex color is not a standard part of obj's vertex definition.
To apply a uniform color to a whole model can be done by 3 means:
1. Attach an mtl file to the obj file which defines the material of the model.
2. Construct an instance of JSC3D.Material and set it to the model mesh
manually.
3. The most convenient way is to specify a default color using JSC3D.Viewer's
setParameter() method in initialization. Then this color will be applied to all
meshes inside a scene which do not have a material:
// in initialization part
...
// specify the default color
viewer.setParameter('ModelColor', '#CAA618');
// set other parameters
...
viewer.init();
viewer.update();
That's it.
Original comment by Humu2...@gmail.com
on 7 Dec 2012 at 3:47
I've anderstood, thanks.
On the contrary if i want different colors for different Vertex shall i only
use texture or may i do it by a .mtl file or any other technique?
Original comment by mariopon...@yahoo.it
on 7 Dec 2012 at 7:55
It is recommended to use a texture when available. For an obj model file,
textures are defined in one or several attaching mtl files.
Original comment by Humu2...@gmail.com
on 7 Dec 2012 at 3:28
Original issue reported on code.google.com by
mariopon...@yahoo.it
on 6 Dec 2012 at 9:09Attachments: