Change color with button
- Dominant language
- HTML
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
```
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
I want to change the modelcolor with a button.
What version of the product are you using? On what operating system?
Please provide any additional information below.
Render quality:
Low
Standard
High
var canvas = document.getElementById('cv');
var viewer = new JSC3D.Viewer(canvas);
viewer.setParameter('SceneUrl', '3d/model.stl');
viewer.setParameter('InitRotationX', 40);
viewer.setParameter('InitRotationY', 40);
viewer.setParameter('InitRotationZ', 30);
viewer.setParameter('ModelColor', '#004B91');
viewer.setParameter('BackgroundColor1', '#F6f6f6');
viewer.setParameter('BackgroundColor2', '#CCCCCC');
viewer.setParameter('RenderMode', 'texturesmooth');
viewer.init();
viewer.update();
function modelcolor(color) {
var mesh = viewer.getScene().getChildren()[0];
mesh.setMaterial(new JSC3D.Material('', 0, color, 0, true));
viewer.update();
};
function setDefinition(definition) {
if(viewer.getScene()) {
viewer.setDefinition(definition);
viewer.update();
}
};
```
Original issue reported on code.google.com by `ilse...@gmail.com` on 27 Jan 2014 at 11:27
Contributor guide
No contributing guide indexed for this repository
Research direction
No repository file or test is mentioned; start with the inline JSC3D.Viewer setup and the modelcolor function, then reproduce the behavior using the supplied canvas and buttons. Inspect the viewer scene and material API to determine why the rendered model does not change color. Done means the color buttons visibly update the model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100