Set color by loading a object
- 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 set the color of a object, when the object is loading
What version of the product are you using? On what operating system?
Please provide any additional information below.
viewer = new JSC3D.Viewer(document.getElementById('canvas'));
viewer.setParameter('SceneUrl', '../duckie/' + duckAccessoires);
viewer.setParameter('ModelColor', '#FFFFFF');
viewer.setParameter('BackgroundColor1', '#FFFFFF');
viewer.setParameter('BackgroundColor2', '#FFFFFF');
viewer.setParameter('RenderMode', 'textureSmooth');
viewer.setParameter('setDefinition', 'high');
viewer.init();
getDuckColor();
function getDuckColor (){
color= #FFFFFF;
var setColor = new JSC3D.Material('', 0, color, 0, true);
setColor.onready = function() {
var scene = viewer.getScene();
var myMesh = scene.getChildren()[0];
myMesh.setMaterial(this);
viewer.update();
}
}
```
Original issue reported on code.google.com by `papa...@gmail.com` on 12 Jan 2014 at 12:34
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing viewer.init(), getDuckColor(), and the JSC3D.Material onready callback in the reported example. Check how viewer.getScene(), the first child mesh, and viewer.update() behave while the object loads; done should mean the requested color is applied reliably during loading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100