Open GoogleCodeExporter opened 9 years ago
You can get test 3ds files from
http://www.toucan.co.jp/3DCG/3ds/FlowerModelsE.html
Original comment by lujian1...@gmail.com
on 11 Jul 2015 at 1:51
Found a way to load texture bmp file as following:
// create a new Texture instance
var myTexture = new JSC3D.Texture;
// setup the handler which will be called when texture is ready
myTexture.onready = function() {
// assume a single model has already been loaded
var scene = viewer.getScene();
var myMesh = scene.getChildren()[0];
// set texture to the model
myMesh.setTexture(this);
// notify viewer to deliver a new frame
viewer.update();
}
// begin to load this texture from a given url
myTexture.createFromUrl('rose/RoseRT.bmp');
Original comment by lujian1...@gmail.com
on 11 Jul 2015 at 2:18
This ticket can be closed. Thanks.
Original comment by lujian1...@gmail.com
on 11 Jul 2015 at 2:20
The only drawback is jsc3d does not have good lightness to the object.
You can compare with http://www.ibiblio.org/e-notes/webgl/deflate/roseR.html
A little disappoint with the results. Any way to improve the lightness?
var canvas = document.getElementById('cv');
var viewer = new JSC3D.Viewer(canvas);
viewer.setParameter('SceneUrl', 'rose/RoseR.3ds');
viewer.setParameter('InitRotationX', 0);
viewer.setParameter('InitRotationY', 0);
viewer.setParameter('InitRotationZ', 0);
viewer.setParameter('ModelColor', '#AAAAAA');
viewer.setParameter('BackgroundColor1', '#007FFF');
viewer.setParameter('BackgroundColor2', '#007FFF');
viewer.setParameter('RenderMode', 'texturesmooth');
viewer.setParameter('MipMapping', JSC3D.PlatformInfo.supportWebGL ? 'off' : 'on');
viewer.setParameter('Renderer', 'webgl');
viewer.init();
viewer.update();
var myTexture = new JSC3D.Texture;
myTexture.onready = function() {
var scene = viewer.getScene();
var myMesh = scene.getChildren()[0];
myMesh.setTexture(this);
viewer.update();
}
myTexture.createFromUrl('rose/RoseRT.bmp');
Original comment by lujian1...@gmail.com
on 11 Jul 2015 at 2:34
Original issue reported on code.google.com by
lujian1...@gmail.com
on 11 Jul 2015 at 1:49