Jump to content

Informations regarding camera settings


Tableuraz
 Share

Recommended Posts

Hi there !

 

I'm having an issue, I can't change my camera's angular sensibility.

I keep trying to change it, but there are no difference, here are the settings I'm applying to my camera :

 

var CAMERASETTINGS = {angularSensibility : 0.01,applyGravity : true,checkCollisions : true,maxCameraSpeed : 0.01,cameraAcceleration : 0.05,inertia = 0,keysUp : [90],keysDown : [83],keysLeft : [81],keysRight : [68],cameraHeight : 1.80,type : "free"}

I would like the camera to "walk" arround instead of flying through the room at rocket speed and I don't want any inertia, but when I set those settings, the angular sensibility seems really low (or high... I still find the "higher is lower" thing about angular sensibility really misleading)...

Thanks in advance for your answer ! ^_^

Link to comment
Share on other sites

Fixed now.

Anyway, I would still be interrested by an explanation about the camera settings...
What is the difference between camera.maxCameraSpeed and camera.speed ? What happens if maxCameraSpeed is lower than camera.speed ?

Does camera.cameraAcceleration become useless when intertia is set to 0 ?

Is there a way to still get inertia when rotating the view but not when moving around ?

Why is the angularSensibility working "backward" ? I've got an idea why, but wouldn't it be more logical if higher values were implying higher angularSensibility ?

Is there a way to still get the camera rotating when the mouse is stuck against the screen's border ? It seems like BabylonJS is getting the mouse location by default, thuse stopping camera rotation if the mouse is not moving (even if the user is trying to move the mouse)... Dunno if I'm cristal clear there...

Link to comment
Share on other sites

Yeah, you're right, I should have checked the source code first, I am not really used to work with open source tools... ;-)
I think I'll look into this strange angularSensibility thing, but I guess dividing the offset by the angularSensibility value is the best in term of optimization, and inverting the way it works (higher value == higher sensibility) would imply at least one more calculation per axis...

Link to comment
Share on other sites

Hi T, welcome to the forum.  Did you understand what DK said... about many of the properties you are speaking-of... being special properties used in followCams only?

 

Come take a drive at Babylon docs with me, if you please...

 

First, to BabylonDocs...  http://babylondoc.azurewebsites.net

 

Don't worry that is says 2.0... we don't care about the version numbers at this time.  Let's look at the SIDE BAR.  In the sidebar, under the Classes category... click the 2.1 folder.

 

Ahh, did you click on the TEXT 2.1?  Not much information there, huh?  Instead click on the little green arrow next-to the 2.1 folder. 

 

Ahh, expansion is happening (drilling).  Let's continue, and click the little green arrow next to BABYLON

 

Boom, a HUGE drill, eh?  Scroll the sidebar down down down... until you see a folder called 'Node'.  Click its arrow to drill THAT folder.

 

Hey, there's the "big three" nodes... mesh, cameras, and lights!  Yay!  Now green-arrow click to drill the camera folder.

 

You get the idea.  Eventually, you will see THIS hierarchy:

 

Camera

    ArcRotateCamera

        AnaglyphArcRotateCamera

    TargetCamera

        FollowCamera
        FreeCamera

            AnaglyphFreeCamera
            DeviceOrientationCamera
            GamepadCamera
            OculusCamera
            OculusGamepadCamera
            TouchCamera
            VirtualJoysticksCamera

 

Now you understand the difference between clicking on the text and clicking on the little green arrows, and now you can see the "super-classes" of your followCamera.  You can see which classes the followCamera inherits methods and properties-from.  For example, the .speed property is inherited by followCamera... from targetCamera.  Click on the TEXT of targetCamera.  About halfway down, you'll see the .speed member/property.

 

Now let's click on followCamera text... which is a subClass of targetCamera.  See that?  No .speed member... but there are two new speed-related members... cameraAcceleration and maxCameraSpeed.  The .speed property is still available on followCamera, because it was inherited from its superClass... targetCamera.

 

Anyway, I just wanted to show you some "relationships" between the cameras... and show you the little green arrows on our BabylonDoc sidebar.  Nobody ever expects tons of information to be hiding in the 'node' folder, but it does.  I thought that you should know about that little hiding place, too. 

 

We're hoping all that information is not so hidden in our new docs, coming... whenever it gets done.  :)  (work IS in progress)

 

And be sure to enjoy our v2.0 Classes Hotlist.  Where is THAT located-at?  It's in GettingStarted/General/  (remember you need to click the little green arrow next to the General folder). 

 

Hey.... there it is... v2.0 Classes Hotlist!  It's pretty handy.  Versions for 2.1 and 2.2 coming soon... but meantime, the 2.0 Classes Hotlist is still real accurate and full of great links and searches.  Bookmark that puppy.

 

So, I think you can start to see... that there is always 4 places to find "the goods". 

 

BabylonDoc and its searcher  (don't forget the tutorials)

Wingnut's pretty forum searcher (or the default forum search at the top of this screen)

GitHub Master Tree (src) and its searcher

Good ol' Google Search (hey, there's YOUR post!)  :)

 

Ok, there's more than 4 places... but those are some good ones.  At least bookmark the first 3 (and maybe bookmark the hotlist if you think it's worthy of such an honor).  Again, welcome, I hope I didn't show things that you already know.  Be well!

 

PS: The angularSensibility setting... is how sensitive the camera is... to air molecule friction.  So, the more sensitive (the higher the value), the slower it moves.  Will you believe THAT one?  (I wouldn't if I were you, but that's a way to wrap your mind around it easier.)  Yes, BJS scenes have air molecules in them.  What's that?  You're not believing that one either, eh?  I don't blame you.  heh

Link to comment
Share on other sites

 Did you understand what DK said... about many of the properties you are speaking-of... being special properties used in followCams only?

Yeah, I got that, I know there are values made for other types than freeCamera, but that's because the camera can change its type depending on some events (determined by my coworkers and I).

 

The angularSensibility setting... is how sensitive the camera is... to air molecule friction.

Exactly ! That, or it's the value used to divide the mouse offset... Still not sure there...  :D

Yes, BJS scenes have air molecules in them.

Well, that would explain some of my performances issues !  :lol:

 

I know that doc, it's in my bookmarks since I started using BabylonJS. I spent hours on it, and it's pretty well made, even if I only use the search function, because the side bar is not THAT handy if you don't already know where to look IMHO...  ;)

As you said, I wouldn't have suspected that the Node class would have so much stuff hidden in it. Even if it's logical now that I think about it.

Anyway, thanks for taking the time to answer my noobish (and stupid) questions and taking me by the hand to explain me how the green arrows worked and making me look like the fool I am  :rolleyes:

Thanks to Deltakosh, I spent some time fiddling around in the source code (modifying some stuff to my liking), and I understood lots of things which were not really explained in the docs or in the tutorials (I guess that's the beauty of Open Source).

 

I hope this thread will help some other beginners wondering about the same things, as it's full of answers now.

 

P.S: If that was not clear from the beggining, I would like to precise that I am pretty much a noob regarding BabylonJS, as we integrated it in our workflow only recently. I learnt a lot by myself in a short amount of time and even if BabylonJS is really easy to use (I've had worse), there are some subtilities. I am not a pro yet but I am working on it. And even if I fix my issues by myself most of the time, there can still be some questions bugging me out sometimes (I might post one sooner or later about the sceneOptimizer, brace yourselves).

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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