Pryme8 Posted March 10, 2016 Share Posted March 10, 2016 how do I use this method? I am trying to create an object where ever the camera is looking so I figured if I can get the center screen points global coordinate Ill be all set... I tried scene.pick(scene.width/2, scene.height/2); but that returns as if I am trying to hit an object not get a coordinate... Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 10, 2016 Share Posted March 10, 2016 Sorry but really do not understand the question. Do you want to (A) set a camera in a fixed direction and then create some object along the line of sight of the camera? If so how far away? (B) as you sweep around with the camera continually create new objects wherever the camera has looked? (C) Something else? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 10, 2016 Author Share Posted March 10, 2016 I want to create an object offset front the cameras forward z by 5. Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 10, 2016 Share Posted March 10, 2016 Why not create object and target camera towards mesh position? Do you want the camera to follow a mesh? If so try a search for follow camera in this forum. Sorry not to be of much help. Perhaps you could explain further what you are actually trying to achieve, ie what a user would see happening?. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 10, 2016 Share Posted March 10, 2016 Something like : mesh.position = camera.getFrontPosition(10); Pryme8, adam, dbawel and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 10, 2016 Share Posted March 10, 2016 Or this: http://www.babylonjs-playground.com/#1USTW#0 adam 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 10, 2016 Author Share Posted March 10, 2016 http://pryme8.github.io/Magic_Marble/editor.html thank you. Implementing this now. **update** implemented line: 452 considering I just started this demo about 4 hours ago im pretty happy... gonna implement customExtrudes now for scale and rotation functions. and then I gotta add other prefabs, I think Ill grab what i learned from https://github.com/Pryme8/TERIABLE and include perlin and worley noise meshes as well :D! 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.