Skip to content
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

color from .obj file #13

Open
GoogleCodeExporter opened this issue Jul 29, 2015 · 3 comments
Open

color from .obj file #13

GoogleCodeExporter opened this issue Jul 29, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.
I  try to load a simple .obj file with simple color information
2.
3.

What is the expected output? What do you see instead?

i'd like to see a objetc with color. Instead i see no color in object

What version of the product are you using? On what operating system?
i use latest version with windows 7 in chrome o IE9

Please provide any additional information below.

I'd like to Know if there's the possibility to read color information by .obj 
file ( not Texture) or if is there a possibility to color an object with a 
uniform color in someway by a command.

Original issue reported on code.google.com by mariopon...@yahoo.it on 6 Dec 2012 at 9:09

Attachments:

@GoogleCodeExporter
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant