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.

Inverted Camera Navigation

Home Forums Puzzles Inverted Camera Navigation

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #3534
    rockybaceable
    Participant

    Hello,

    There are a couple of things I would like to try to do with the camera:

    :unsure: Is it possible to invert the navigation of the camera? Currently, while using a Free Camera (stationary camera without target) if you click and drag to the left, your camera looks to the left. Would there be a way to invert this? IE: if you click and drag to the left, the camera could look right? This would be more like you are “grabbing” the scene and the part you click stays attached to your mouse/finger. Behaving more like a 360 video in a 360 player (like YouTube).

    :unsure: Similar to this, I would also like to be able to lock the camera and target together, so clicking and dragging would position the camera and target together, instead of rotating the camera. I would like it to behave more like viewing an image/photo on a smart phone. Again, it would be more like the part of the scene you click would stay attached to your mouse/finger if you click and drag… would this be possible?

    I am using 3DSM. Thank you!

    -Rocky

    #3543

    Hi Rocky,

    The first thing can be done by coding. If you create an application via the Verge3D App Manager, you’ll have the main js file of your app with the function runCode in it, which looks like that:

    
    function runCode() {
        // add your code here, e.g. console.log('Hello, World!');
    
    }
    

    There you can paste the following lines:

    
    if (app.controls) {
        app.controls.rotateSpeed *= -1;
    }
    

    – this just inverts the rotation controls.

    Regarding the second question: I think you can do it now by dragging with both left and right buttons pressed. Is this the behavior you are looking for?

    Co-founder and lead developer at Soft8Soft.

    #3544
    rockybaceable
    Participant

    hello Ivan,

    adding that line of code did, in fact, give me the inverted controls I was looking for.

    Also, yes, right clicking (or I assume two button click on mac) is the effect I’m looking for… but I would like that to be assigned to the left click, and it be the only camera control you have on a certain project.

    Thanks for your help!

    -R

    #3561

    You’re welcome!

    Such reassigning should also be easy to do, but somehow it was supported only for the Target Camera :unsure: . We’re going to fix this for the Free Camera in the upcoming max release, which will most likely happen today.

    So, to bind it to the left click and to disable other controls you can add the following snippet into the runCode function:

    
    if (app.controls) {
        app.controls.enableRotate = false;
        app.controls.enableZoom = false;
            
        app.controls.mouseButtons.ROTATE = -1;
        app.controls.mouseButtons.ZOOM = -1;
        app.controls.mouseButtons.PAN = v3d.MOUSE.LEFT;
    }
    

    Co-founder and lead developer at Soft8Soft.

    #3960
    rockybaceable
    Participant

    hi Ivan,

    thanks for your replies. I was mostly able to get it to work. I was able to invert the rotate controls, and also lock the pan tool on one project… but on another I have yet to be able to get the pan controls to be tied to left click (or touch & drag on mobile).

    I have attached a screenshot of the modified code. I actually had to change “app.controls.mouseButtons.PAN = v3d.MOUSE.LEFT” to “”app.controls.mouseButtons.PAN = v3d.MOUSE.RIGHT” otherwise I was unable to pan at all. With this code, however, I have to use the right click to pan, and I am unable to pan on mobile.

    :unsure: How can I ensure left click (or click & drag on mobile) will pan the camera?

    Thank you!

    -Rocky

    #3963

    Hi Rocky,

    it should work if you add the following line into runCode:

    
    app.controls.mouseButtons.ROTATE = -1;
    

    then you can change “app.controls.mouseButtons.PAN” back to “v3d.MOUSE.LEFT”.

    It should also work on mobile with 3-fingers drag – this is not customizable at the moment, but we can think about adding the ability to change it to the 1 or 2-fingers action, if you need it.

    Co-founder and lead developer at Soft8Soft.

    #3968
    rockybaceable
    Participant

    hi Ivan,

    I tried adding the line of code like you suggested… unfortunately, I still cannot get the pan control to be left click and/or 1 finger drag.

    Maybe there could be a way to click/touch and drag the actual object instead of the camera? I’m basically trying to make an annotated document that the user can pan and zoom to be able to read.

    Thanks!

    -Rocky

    #3977

    I tried adding the line of code like you suggested… unfortunately, I still cannot get the pan control to be left click and/or 1 finger drag.

    Hmm, this is strange. I tested it just now on a simple newly created application and it worked for me.
    You said that you were able to make it work on one project, but not on another. So, maybe it depends on a particular scene file, camera settings, etc… Can you provide an example of a project where the left-click binding doesn’t work? Actually, it should be much easier to customize the camera controls than to drag a scene object.

    Co-founder and lead developer at Soft8Soft.

    #39559
    sirhc
    Customer

    Hi Ivan :bye:
    I tried your:

    if (app.controls) {
    app.controls.rotateSpeed *= -1;
    }

    This work for mouse but not for touch control.
    Am I doing something wrong? :wacko:

    Greets Chris

    Absurdly big demo (60mb) ‘work in progress’ :
    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:ac6e684bfe/applications/teleport-Flamco/teleport-example-blender.html

    Attachments:
    You must be logged in to view attached files.

    Technical Artwork Specialist@TBL.nl

    #39563

    Hi sirhc,

    Touch speed is affected by a different property rotateSpeedTouch. So you also need to add this line:

    
    app.controls.rotateSpeedTouch *= -1;
    

    Co-founder and lead developer at Soft8Soft.

    #39564
    sirhc
    Customer

    Awesomely quick reply!!! :good:
    I’m gonna check it out!!
    Super tnx!
    Chris

    ———————
    WORKED!

    Technical Artwork Specialist@TBL.nl

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