Nabroski Posted January 22, 2017 Share Posted January 22, 2017 @iTekVR do you mind to share a screenshot of the application you are working on? i'm just wondering. Quote Link to comment Share on other sites More sharing options...
Visam Posted January 22, 2017 Share Posted January 22, 2017 33 minutes ago, Nabroski said: @iTekVR do you mind to share a screenshot of the application you are working on? i'm just wondering. @Nabroski I sent you the private message Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 23, 2017 Share Posted January 23, 2017 @iTekVR Okay, nice. Its not that hard as it sounds ... You need this:http://math.hws.edu/graphicsbook/demos/c7/rotators.html the basics:http://www.babylonjs.com/cyos/#2FK9TG Overwrite me: BABYLON.Camera.prototype.getWorldMatrix = function() { if (!this._worldMatrix) { this._worldMatrix = BABYLON.Matrix.Identity(); } var viewMatrix = this.getViewMatrix(); viewMatrix.invertToRef(this._worldMatrix); return this._worldMatrix; }; etc... BABYLON.ArcRotateCamera = function(name, alpha, beta, radius, target, scene) { BABYLON.Camera.call(this, name, BABYLON.Vector3.Zero(), scene); this.alpha = alpha; this.beta = beta; this.radius = radius; this.target = target; this._keys = []; this.keysUp = [38]; this.keysDown = [40]; this.keysLeft = [37]; this.keysRight = [39]; this._viewMatrix = new BABYLON.Matrix(); BABYLON.ArcRotateCamera.prototype._initCache.call(this); this.getViewMatrix(); }; BABYLON.Vector3.Unproject = function(source, viewportWidth, viewportHeight, world, view, projection) { var matrix = world.multiply(view).multiply(projection); matrix.invert(); source.x = source.x / viewportWidth * 2 - 1; source.y = -(source.y / viewportHeight * 2 - 1); var vector = BABYLON.Vector3.TransformCoordinates(source, matrix); var num = source.x * matrix.m[3] + source.y * matrix.m[7] + source.z * matrix.m[11] + matrix.m[15]; if (BABYLON.Tools.WithinEpsilon(num, 1.0)) { vector = vector.scale(1.0 / num); } return vector; }; and so on But i think, someone will write a nice wrapper function for you! (soon) Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 23, 2017 Share Posted January 23, 2017 you can also make you own trackball. mesh1.target =trackballmesh (this is not a trackball - i just fooling around) http://www.babylonjs-playground.com/#2EE9UD#17 Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 1 hour ago, Nabroski said: @iTekVR Okay, nice. Its not that hard as it sounds ... You need this:http://math.hws.edu/graphicsbook/demos/c7/rotators.html .......................... But i think, someone will write a nice wrapper function for you! (soon) YES! I need exactly this trackball rotator! Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 23, 2017 Share Posted January 23, 2017 If you don't want to mess around with WebGL you can create 2 Meshes and then overload the rotation. Hope your company grows quicky and can hire a dev for this Good Luck, man, report if their is something else. Have a nice day. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 23, 2017 Share Posted January 23, 2017 so im relaxing(from hard work) maybe some1 find it useful i leave it herehttp://www.babylonjs-playground.com/#19K1J2#18 Quote Link to comment Share on other sites More sharing options...
chadautry Posted January 27, 2017 Share Posted January 27, 2017 This thread caught my eye. Reminded me of an old problem I had Unfortunately I never got around to the further investigations or pull request. For my own work I continued to use ArcRotate camera, but took over the controls all myself. Haven't re-implemented tilt/rotate, but I'll still likely micromanage that myself instead of delegating back to the camera's controls once I do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.