We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Control Min/Max distances

Home Forums Programming Control Min/Max distances

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #67023
    David Duperron
    Customer

    Hi!
    Does anyone know if it is possible to modify the camera Min and Max distances after the gltf export, using puzzles or javascript?
    I don’t see any camera parameter that seems to reflect this in there:
    Perspective Camera
    Or perhaps this is defined as a constraint to the camera?
    Any help would be appreciated!
    Cheers

    David

    #67025
    David Duperron
    Customer

    Changing the camera Object controls using javascript does not seem to have any effect:

    const camera = app.scene.getObjectByName('Camera')
    
    camera.controls.orbitMaxDistance = 1500;
    camera.far = 3000;
    console.log(camera)

    using the above code I change the max distance from 500 (original Blender setting) to 1500, and the far distance from 1500 to 3000 but it does not change anything in the 3D viewport…

    #67027
    kdv
    Participant

    https://www.soft8soft.com/docs/manual/en/puzzles/Camera.html#set_camera_param

    but it does not change anything in the 3D viewport…

    You didn’t say the magic words “Please, update the controls” :unsure:

    app.camera.updateProjectionMatrix();
    app.camera.controls.assignToControls(app.controls, app.scene);
    app.controls.update();

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #67086
    David Duperron
    Customer

    Haha! I should have listened my parents better I guess…
    Anyway: THANK YOU! ;)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.