Jump to content

Camera members/attributes ?


Recommended Posts

Hi. I've just started playing with babylon.js and one of the things I'm trying to do is set the camera like in Diablo game.

So, I edited one example in playground disabling attachControls, and then seting the event handler for click event, so that on every click camera is moved foward by 1.


My question is: there is no member called position neither on FreeCamera class, nor on Camera, nor on Node. Where is this property then? Position is one of the parameters for contstructor, but I can't see it as a member/property of camera object/class. So why does this work at all? 



Also, is would this be the correct way to implement this type of camera (moving it backwards/foward, right/left as the user will move the mouse to the screen edges).


Edited playground example


Thanks a lot in advance!



Link to comment
Share on other sites

Hi lavokad, welcome to the forum, good to have you with us.

Your click to move cam is working nice.  There have been quite a few experiments with moving cameras and moving mesh... with clicks or mouse-overs.  I have never played Diablo... but if you describe the type of movement you are wanting, we all can help you accomplish it, gladly. Personally, I like WASD keys, and I also like a mouseover system that some us threw together... http://playground.babylonjs.com/#TTLMJ#3

(the four border panels can be made completely invisible, as wanted).

Anyway, hope these things help, and again, please describe what you want, because not all of us know what Diablo cameras are like.  :)  Be well.

Link to comment
Share on other sites

Ok, so, for punishment for your embarrassment, you must promise to tell us about your ideas and projects, and share cool things you discover.  Even share the simple things.  If you are excited over something, anything, then we will be, too.  :)


By the way, I have accumulated over 40 on-forum embarrassments, so, you have some catching-up to do.  ;)


Good to have you with us... I like your personality.   Keep hanging-out with us if you can, and tell us about you, a bit, if you want.  This very-active forum has some great artists, storytellers, experimenters, techies, innovators, and mad scientist goof-balls.  I think you'll fit right in, Lavokad.  :)

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...