Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Setting Camera Limits

    3D Blocks
    1
    1
    271
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

       

      Prerequisite

      • Using an Orbit Camera for 3D Scene Navigation

       
       

      Description

      You can set limits to an orbit camera using this block:

       

      Parameters

       

      • Radius Min/Max: These 2 numbers set the minimum and maximum distance between the camera and its target point. For example, if you set them to 300 and 400, then you can not zoom the camera towards the target point closer than 300 units, or further away than 400 units.

       

      • Visible Range Min/Max: These 2 numbers control the range of objects in the scene that are displayed in the camera. For example, if we set them to be 5 to 1000, then any object that is closer than 5 units to the camera or further away than 1000 units from the camera will not be shown in the camera.

       

      • V-angle Min/Max: These 2 numbers control the V-angle of the camera. By default it is between 0 and 180, which covers all angles. However, if you set it to a smaller range, such as between 45 and 90 degrees, then the camera can not tilt above or below this range:


       

      • Pan/Rotate Speed: The last 2 inputs control how fast you can manually shift or rotate the camera. The larger these numbers, the faster the camera will move. For example, here is the difference between a panning speed of 500 vs 5000:

       
       

      Example

      One situation where we have to set the camera’s visible range is when we use a different sky. The “set sky” block would add a huge skybox to the scene, but a normal orbit camera would not see that far. Therefore, we need to enlarge the visible range of the camera after setting the sky:

      1c408045-9280-407c-9432-732583d8827c-image.png

       

      7a06396d-f20e-4ed9-bc43-28c1789e7035-image.png

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post