Search the Community

Showing results for tags 'freecamera'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 37 results

  1. Hi, there. How to make a FreeCamera rotate only by Alpha rotation? Only longitudinal? I want to turn off a Beta rotation (up and down rotation of camera). Thanks.
  2. Hi gang! Once before, I tried adding mousewheel to FreeCamera. I try again, for fun. Watch console. Working okay, so far. But, you know, I would like mousewheel to move camera along direction vector returned-from scene.activeCamera.getDirection(BABYLON.Axis.Z) Currently, mousewheel moves camera along worldspace Z axis. If someone could fix line 33, so that camera moves along dir.z axis, that would be swell. Thanks! For a longer-term solution, does anyone think it would be wise/useful... to add babylon.freeCameraMouseWheelInput.ts to this list: ? The way I am using... is small and works pretty good, but it is not using the camera inputs system. Maybe it should? *shrug* Comments welcome on that. thx.
  3. So I have a ArcRotationCamera that is fixed on a target sphere. When I click a different sphere, I would like to animate the camera to move to and zoom in on the new target. Unfortunately I haven't been able figure out how to smoothly animate ArcRotateCamera switching to a new target like that, so my solution so far has been to switch to a FreeCamera, which I can then animate to the new target, and afterwards switch back to the ArcRotateCamera on the new position. Unfortunately the perspective is bugging out and is very janky to say the least. Basically the camera should turn towards the targeted sphere like the box does in this example: It seems like something that should be so simple to do, but I've been stumbling around this problem for a couple of days, and this is the best I've come up with so far: Anyone who knows a proper way to solve this problem?
  4. I'm getting the freecamera values but they are radians and if i continue rotate they increase more than 6.28 or less than -6.28 . So whay i do for conversion actually is: (camera.rotation.y*360)/6.28 So i get the camera values as i want. But i can figure how fix the infinite rotation value thing, maybe there is some function or something i missing to avoid that?
  5. Hey everyone ! Yesterday, I tried to upgrade my scripts to the the latest version but I found a little problem I think. When I increase the FreeCamera speed, the sensibility or sensitivity (I don't know which word I should use) just goes wrong So I recreate the problem here : Can someone tell me what can I do to fix this problem ? Thank you in advance!
  6. Fixed FreeCamera position

    Hey guys, is there a posibility to fix the FreeCamera's position. So the camera won't move on key-press. I just want to rotate the camera on key-press. Thanks in advanced Benji
  7. Hi all, Update - 17 / 02 mesh.collisionGroup = maskNumber; have been added to AbstractMesh. Two new properties, collisionGroup and collisionMask, have been added to AbstractMesh, collisionMask have been added to FreeCamera, and is coming with 2.6. Why? What do they do? The collisionGroup & collisionMask checks whether a camera Vs mesh or mesh Vs mesh collision should happen. Thus, it allows us to customize collisions, enabling us to decide what meshes should collide with each other and which meshes should collide with the camera An example could be to have collisions between the camera and a box aswell as the camera and a sphere, but no collision between the sphere and the box all at the same time. Once it's live, it will work like this; var group1 = 1; // x to the power of 2, starting from 1. var group2 = 2; // 1*2 = 2 var group3 = 4; // 2*2 = 4 var group4 = 8; // 4*2 = 8, and so on. // This mesh is part of the group1 collisionGroup, camera's and other (moving) meshes with group1 in their collisionMask will collide with this mesh. mesh.collisionGroup = group1; // While moving, this mesh will collide with other meshes which has either group1 or group2 as their collisionGroup mesh.collisionMask = group1 + group2; // While moving, the camera will collide with meshes which has either group1 or group2 as their collisionGroup camera.collisionMask = group1 | group2; // doing group1 | group2 has the same effect as, but is less dynamic than, group1 + group2 You can also do; camera.collisionMask = group1; // Set mask to collide with group1. camera.collisionMask += group2; // Set mask to also collide with group2. camera.collisionMask -= group1; // Remove group1 from mask so we only collide with group2. // Take careful note before using this method, to avoid issues, you must first override the default mask (-1) by doing cameraOrMesh.collisionMask = your_group_x_variable; It is currently not available for webworkers. Backwards compatibility, If this isn't something that interests you, you're all good, nothing has changed. Masks Masks are numbers to the power of 2, starting from 1. Special masks -1 ; Always collides. 0 ; Never collides, overrides mask -1. // not recommended to use on camera with standard gravity applied. Standard masks , x to the power of 2; 1 | 1*2 = 2 | 2*2 = 4 | 4*2 = 8 | 8*2 = 16 | etc. 1 2 4 8 16 Etc PG Example; The camera collides with the ground & box, but not with the sphere and the sphere and box doesn't collide with each other either. Cheers. If you have any questions, ideas or thoughts, please do continue the discussion below.
  8. Hi all I have a free camera which has a mesh which in front of it which is 70 cm wide (x) and 110 cm length (z) with it's pivot point at the its center. Now I want this mesh to be constantly in front of my free camera when the camera is moving. The problem starts when I start to rotate the camera. I want the mesh to be in the center of the screen (in the direction of the camera) and at a fixed distance from the camera. Is that possible? Does it involve complicated math calculations? Would a followcamera do the job? cart.babylon
  9. I'm using a FreeCamera, gravity,etc... and when i look at the sky and press W to go forward i go up and can fly, the same if i look at the floor and press back. I want that with WASD the camera moves without take the Y.rotation in consideration, because i still need to move the camera and rotate to look everywhere. How can i achieve that? I tried with "Camera.CamFrontX(Distance)" , Camera.DirectionX(AxisX, AxisY, AxisZ) ,etc... to fix the Y.Rotation value but never got the desired behaviour, sometimes the Y is limited and i can't climb ramps or stairs, other the collisions are not detected or other weird stuff.
  10. Hello, I think I am not very well understood the function of the rotation properties on a free camera ... Watch this playground: Why does my variable rot changed? I think I must be so tired to understand the problem If someone has an explanation for this problem thank you. Ps: It works very well with an arcRotatecamera by adjusting Alpha and Beta values. Thanks
  11. Hey Guys, I intend to change the use of arrow keys for FreeCamera. I want the camera to rotate around its axis when pressing the left or right arrow keys as opposed to its current movement to left or right. How can i do this? I tried setting noPreventDefault to false in camera attachcontrol but it dosent seem to stop the movement of camera left or right. Am i missing something here? Thanks
  12. I am trying to capture a FreeCamera's location and pan angle or rotation so I can reposition the camera later with the exact same view. (I am working with the playGround Collision example) I seem to be able to get camera.position.x, camera.position.y and camera.position.z ok but camera.cameraRotation.y just yields zero every time
  13. FreeCamera 'Look At'

    Hello, I've been adding features to my game, and came across a weirdness that I don't know how to explain! I've created the basis for my question here. There are a number of objects in the game scene, and I want the player to be able to choose one to look at. I am using the FreeCamera, since it suits my purposes. After adapting the TargetCamera.setTarget function to return the rotation vector of a camera without setting its target explicitly, I can now create an easing animation which gracefully orients the camera in that direction. The link above demonstrates this working in a loop which starts one animation, then on completion, selects a new random target, and starts the animation all over again. The problem is Line 45: camera.rotation.z = 0; Without this line, at the end of the animation, the camera.rotation (normally a Vector3 with x,y,z) becomes a Vector2 with x,y. This causes the screen to go black after the last frame of animation. Now, my two questions: 1. Why? It seems to me that dropping the last part of a Vector3 at the end of an animation is a bug, but my inexperience with BabylonJS makes me think there is probably a better explanation. 2. Is there a better way that I could animate a FreeCamera's orientation? Thanks for your time, and if this solves a problem for anyone, please enjoy the code Cheers, - Peter
  14. Hi there, I'm having a problem getting a playground sample to work on my xampp localhost, I got the Zip file of the Collisions example from the playground ( -9 Collisions), the freecamera works perfectly when I run the online example, but when I test it on the localhost, the camera won't move at all, it will rotate with the mouse, but will not respond to my arrow key presses. Can someone explain why does the example works online and not on local ? Update: When tested using Internet Explorer, it works, but does not work using Firefox or Opera. So is there a difference between IE and other browsers conserning handling local html files ?
  15. Free Camera falling

    Hello, When I am using free camera and attached controls, camera is falling only for about 1 second and than stops. I have to press control key to begin falling again. Can increase this duration or give camera instruction to fall (something like moveWithCollisions )? Thanks!
  16. I have free camera in orthographic camera mode. I don't want camera to move at all on mouse or any other kind of input. So I tried not calling attachControl with this, camera doesn't react at all (Good!) but boxes in this scene with actions registered to action manager also do not react to mouse inputs. Second approach I tried is calling attachControl with following function: scope.registerBeforeRender(function () { // I want top view camera.rotation.x = Math.PI / 2; camera.rotation.y = Math.PI / 2; camera.rotation.z = 0; }); When I try to move ground with mouse it does move slightly. As shown in image. Help needed.
  17. WorldSpaceCanvas problem with FreeCamera

    Hera is an example, I created two worldspacecanvas named canv1 and canv2, In the beginning, canv2 is over can1, but canv2 will be under canv1 when canv2.position is reset. It happens on using FreeCamera, AcrRotateCamera is no problem. Is it a bug ? @Nockawa
  18. Hi All, I want to move(Like animation without pressing keys) Freecamera in a uneven path (vector3 array). For ex: I think the same question has been asked in our forum by other people. and i searched in some of the threads and in BABYLONJS Animation tutorial also, but it was like Start point and end point.using animation we can move from one point to another point. i have implemented TweenLite for moving camera, it is working but the the movement is smooth . but i want to move camera automatically in a series of provided vectors(vectors array) like animation.
  19. Hi, i don't know whether is this is a bug or not (or)i don't know whether other people experienced this behavior . when i press and hold back button while looking at ground the frecamera jumps into air and slowly it drops down. for example: take flat2009 look at ground . Click and hold back button camera jump sand touches the roof after that the camera start dropping slowly.
  20. Hello, I want to make a target camera since 3d software with a aim constraint between camera and is target and animate . This camera rig is better for me to animate because i do not have to animate the rotations. To do this i use scene register before render like this: Do you know if he would have a better solution. Thanks
  21. Get rotation of camera

    I have an application where I have an FPS like camera that moves around a scene. I want to be able to use a camTo function to move the player around the scene. I have a position v3 and target v3. If I do not have a rotation value, the camera is not looking at the target. Is there a way to calculate the rotation knowing the position of the camera and the position of the target. Is my approach to this incorrect? How do I correctly move my freecamera to the correct location and ensure that it is looking at my desired target?
  22. Hi, I'm trying to figure out how to rotate a FreeCamera on Z axis without using a handler. In this example, I only can rotate the camera using the handler. You can comment/uncomment the rotation lines in the renderLoop in order to see the difference. Do you understand what I want to show ?
  23. Hi, I am using Freecamera for my scene, i want to rotate ,i don`t want to move how can i restrict the movement only rotation has to work.
  24. Free camera to walk on steps

    Can any help me ,how to make our FPS Camera (Free camera) to walk on steps
  25. Can I be regulated by the rotation inertia in the Free Camera? Or disable inertia.