BabylonJS Tutorial Series -- Part 2: Cameras
ฝัง
- เผยแพร่เมื่อ 29 พ.ย. 2016
- In this part of our ongoing BabylonJS tutorial series we look at creating cameras. We specifically look at Free, Arc Rotate and Follow cameras with a quick discussion of other camera options available in the game engine.
The source is available here:
www.gamefromscratch.com/post/2... - เกม
BabylonJS Links:
www.gamefromscratch.com/page/BabylonJS-Tutorial-Series.aspx
Now I see why everyone wanted to go to Babylon. I'm impressed, worthy to be used by me.
Awesome tutorial! A couple things:
A mix up in the ASCII numbers the code will work right he just mixed the letters up when saying them. 87=W, 83=S , 65=A, 68= D.
Also in order to get follow camera to work in updated versions uses camera.lockedTarget = box; instead of camera.target = box.
Thanks
Hmm
Thank you!
Its no longer *camera.target=box;* its now *camera.lockedTarget=box;*
thank you
Thank you so much
U saved my life dude
Thankssss
God bless you.. I was over here tripping!! lol
Very helpful. Many Thanks.
great help
There is an error explained during keys in the video. I guess 68 is for D and 83 is for S, what I being told is opposite of this.
The part about "followCam" doesn't work. Nothing is shown except a white screen.
instead of BABYLON.Vector3.Zero() try BABYLON.Vector3(0,0,-10) in the second parameter of BABYLON.FollowCamera()
@@Torben43 i used new BABYLON.Vector3(0,0,-10). The new keyword works for me.
I used new BABYLON.FollowCamera("followCam", BABYLON.Vector3.Zero(), scene, box) putting the locked target in the constructor. Worked this way. ;-)
Do you think BabylonJS would be good choice for mobile platforms? I would like to see a demo of that if you're up for it. Thanks.
Kind of an aside about the w, a, s, d camera movements:
When I tried the First Person Shooter-style camera movements found here--
doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
--everything worked, except that (while the canvas is not in fullscreen) the down arrow key causes my whole html page to scroll downward while at the same time backing up the first person ellipsoid and the camera it's attached to. The up arrow key would then scroll the page back up into position while moving the ellipsoid forward. When I searched for a way to resolve this, besides using fullscreen (which I don't want to do for my project), I came across the ASCII w, a, s, d code here, tried it, and found that it resolves the scrolling problem. Just in case anyone else has had this problem...
I should add that w, a, s, d keys, in this FPS camera scene, move the ellipsoid/camera forward, backward and from side to side, instead of up and down, etc.
I love the sigh every time you have to type BABYLON.function
Some Babylon.js API has changed, so some of the codes in the video is deprecated. For example, the "followCam.target" should be "followCam.lockedTarget".
You saved me so many troubles, I just had the problem with the target camera, this helped me
camera.target = box2 doesnt work anymore. Use camera.lockedTarget = box2;
the FollowCamera is still not working. what the hell is the problem. i checked doc.babylonjs.com/babylon101/cameras#constructing-a-follow-camera
it seems like I followed the procedure but still it didn't work
Also i've read the comments down there and i tried most of them it did not work.
SOrry, fixed. Removed new at new BABYLON.Vector3 and added lockedTarget instead of target.
you said z right
but you said it wrong the first time
which is zee
TypeScript version on Playground: plnkr.co/edit/bqTt2id0l06ObLpDtbZg?p=preview
your tutorial does not work, you can make the change to the video by putting text over it. To not do that is just sloppy.
Not sure how it's sloppy, this was made 2 years ago by the time you wrote this.