Google Code Exporter
Google Code Exporter
``` I tried rotate but it not work var canvas = document.getElementById('cv'); var viewer = new JSC3D.Viewer(canvas); viewer.setParameter('SceneUrl', 'bank/Western_Bank.obj'); viewer.setParameter('InitRotationX', 0); viewer.setParameter('InitRotationY', 0); viewer.setParameter('InitRotationZ', 0); viewer.setParameter('ModelColor', '#CAA618'); viewer.setParameter('BackgroundColor1', '#E5D7BA'); viewer.setParameter('BackgroundColor2',...
``` viewer.rotate() makes incremental rotations. I guess you should save the current rotation angles before call of viewer.replaceSceneFromUrl() and then restore them using viewer.rotate(). ``` Original comment by `[email protected]` on...
``` I set: viewer.setParameter('SceneUrl', 'bank/Western_Bank.obj'); viewer.setParameter('InitRotationX', 0); viewer.setParameter('InitRotationY', 0); viewer.setParameter('InitRotationZ', 0); $('#change-obj').click(function(){ var rotationAngles = viewer.getRotationAngles(); viewer.replaceSceneFromUrl('bank/Western_Bank_2.obj'); viewer.rotate(rotationAngles[0],rotationAngles[1],rotationAngles[2]); viewer.update(); }) but not work. Rotation is 0 0 0 although I...
``` I'm afraid you forget the loading is asynchronous. When you call viewer.replaceSceneFromUrl(), it won't be done immediately. The correct method is to utilize the callback mechanism, overriding viewer.onloadingcomplete (http://jsc3d.googlecode.com/svn/trunk/jsc3d/docs/symbols/JSC3D.Viewer.html#onlo...
``` Yes. Thank you. Rotation it work. But each click, it makes INCREMENTAL rotations. How to reset this to 0 0 0 then resume rotate with rotation current? ``` Original...
``` Because I set viewer.setParameter('InitRotationX', 45); viewer.setParameter('InitRotationY', 45); viewer.setParameter('InitRotationZ', 30); not 0 0 0 => each click, objModel will INCREMENTAL rotation, not resume ``` Original comment by `[email protected]` on 1...
``` [deleted comment] ```
``` I see. Try to add this new function to jsc3d.js and use it instead of rotate() then: JSC3D.Viewer.prototype.setRotations = function(rotX, rotY, rotZ) { this.rotMatrix.identity(); this.rotMatrix.rotateAboutXAxis(rotX); this.rotMatrix.rotateAboutYAxis(rotY); this.rotMatrix.rotateAboutZAxis(rotZ); }; It...
``` Thank you so much. It's work very well ``` Original comment by `[email protected]` on 2 Aug 2014 at 4:55
``` Hello, I am new at jsc3d, can you show me how to set to the fixed position on click event, when the object is at any axis. I mean...