fateriddle Posted October 18, 2018 Share Posted October 18, 2018 1. Want to build a ball with texture, and if shown on phone, you can touch and swipe the ball, ball will spin according to your swipe direction. Is it possible on Babylonjs? 2. Also if I draw an aim (a cross) in center of the screen, is it possible to know if the aim "hits" any mesh? I know pointer can do that by looking into pickInfo.hit, but is it possible for a fix point on the screen (knowing its clientX and Y) which is not the pointer? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted October 18, 2018 Share Posted October 18, 2018 hi @fateriddle with babylonJs Anything is possible (:D) https://www.babylonjs-playground.com/#BVG26D#2 look your browser console ** you can make pick by OnPickTrigger in ActionManager https://www.babylonjs-playground.com/#BVG26D#3 ssaket 1 Quote Link to comment Share on other sites More sharing options...
fateriddle Posted October 18, 2018 Author Share Posted October 18, 2018 Thanks, really cool demo. But it feels like not exactly what I want... 1. About the aim, I kinda think of a normal shooting game, where there's an aim drawing on the center of the screen. So whenever you press a key, if anything in the babylon 3d world is on the aim, it will be shoot down. So it is not a mouse moving onto the target thing (so not onPointerOverTrigger)... what I find confused is that aim is not the pointer, so I don't know what api to use. Edit: I find raycaster maybe what I what to use, but still have no idea how to create a ray from camera to the (x,y) point on device screen... 2. And I'm a bit confused, is the second playground demo showing similar pointer trigger, or is it about ball spinning? @NasimiAsl Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted October 18, 2018 Share Posted October 18, 2018 https://www.babylonjs-playground.com/#BVG26D#9 Wingnut 1 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.