Add / change the texture of 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. How can i change the texture of a object?
2.
3.
I want to change the pattern of my Google Sketchup Duck:
Code:
viewer = new JSC3D.Viewer(document.getElementById('canvas'));
viewer.setParameter('SceneUrl', 'duckie/duckie.obj');
viewer.setParameter('ModelColor', '#FFFFFF');
viewer.setParameter('BackgroundColor1', '#FFFFFF');
viewer.setParameter('BackgroundColor2', '#FFFFFF');
viewer.setParameter('RenderMode', 'textureSmooth');
viewer.setParameter('setDefinition', 'high');
viewer.onmousedown = function(x, y, button, depth, mesh) {
if (button === 0/*left button down*/ && mesh !== null) {
var newMat = new JSC3D.Texture('duckie/blackandwhite.png', true);
mesh.setTexture(newMat);
viewer.update();
}
};
viewer.init();
```
Original issue reported on code.google.com by `papa...@gmail.com` on 16 Dec 2013 at 9:11
Contributor guide
No contributing guide indexed for this repository
Research direction
The report identifies the Viewer setup, mesh.setTexture, and duckie/blackandwhite.png, but names no files or tests. Start by tracing how JSC3D loads textures and applies them to meshes, then clarify whether the desired outcome is documentation or a code change and verify it with the sample Duck model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100