JCPalmer Posted March 30, 2015 Share Posted March 30, 2015 I am starting in earnest the making of the orthographic 2nd camera for displaying dialogs in front of a scene. Need to pick a camera, one that does NOT move, but handles only clicks / touches. Any recommendations, or should I subclass Camera? Also, is it a problem when 2 cameras try to attach? Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 30, 2015 Share Posted March 30, 2015 Hey JC, I needed a custom camera for one of my projects (with custom controls and custom behaviour), I tried subclassing FreeCamera, and it works great.But for your this, I don't know if you really need to create a custom class. Why not use an arcRotate ? http://www.babylonjs-playground.com/#1EXXKT There is no problem to attach two camera, but only the last one will be set as activeCamera.If you want to handle multiviews, you need to push both cameras in scene.activeCameras (notice the 's' at the end). http://doc.babylonjs.com/page.php?p=22461 JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 30, 2015 Author Share Posted March 30, 2015 Temechon, Thanks for the playground. I was planning on doing most of my work right in the HTML initially, then switch to typescript once developed. Any camera camera works for that. I pasted your 5 ortho line in my Dialog Test / Demo page. Page looked a little better & not quite as wide ( I thought I was looking directly at it already). Something weird also happened: With the mouse button down, dragging left-right rotates the panel in the opposite direction from before. Could not reproduce in the playground example. True, Arc rotate never moves, but stray drags / gestures could rotate it. I have a hard requirement for a proprietary control / BasePanel subclass that I will build outside of the repository. It must not move and always be viewed straight on. Do not wish to limit others with my special requirements. If only there was a way to switch to pick only attachment. I am not the first to have a reason for wanting this. http://www.html5gamedevs.com/topic/11151-move-arcrotatecamera-only-under-certain-conditions/?hl=attachcontrol Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 30, 2015 Author Share Posted March 30, 2015 Whoops, I can use Arc rotate camera with the same trick as above. I got confused with the ".state" thing when it was the angularSensibility which froze it.arcCamera.angularSensibility = Infinity;arcCamera.state = "off";So Arc rotate it is. Will have a switch that makes it more apparent. 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.