- This topic has 10 replies, 3 voices, and was last updated 3 years, 8 months ago by sirhc.
-
AuthorPosts
-
2018-04-12 at 3:56 pm #3534rockybaceableParticipant
Hello,
There are a couple of things I would like to try to do with the camera:
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).
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
2018-04-12 at 9:00 pm #3543Ivan LyubovnikovStaffHi 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.
2018-04-12 at 10:06 pm #3544rockybaceableParticipanthello 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
2018-04-13 at 9:14 am #3561Ivan LyubovnikovStaffYou’re welcome!
Such reassigning should also be easy to do, but somehow it was supported only for the Target Camera . 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.
2018-04-25 at 9:11 pm #3960rockybaceableParticipanthi 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.
How can I ensure left click (or click & drag on mobile) will pan the camera?
Thank you!
-Rocky
2018-04-26 at 9:42 am #3963Ivan LyubovnikovStaffHi 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.
2018-04-26 at 3:08 pm #3968rockybaceableParticipanthi 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
2018-04-26 at 3:43 pm #3977Ivan LyubovnikovStaffI 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.
2021-03-18 at 12:39 pm #39559sirhcCustomerHi Ivan
I tried your:if (app.controls) {
app.controls.rotateSpeed *= -1;
}This work for mouse but not for touch control.
Am I doing something wrong?Greets Chris
Absurdly big demo (60mb) ‘work in progress’ :
https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:ac6e684bfe/applications/teleport-Flamco/teleport-example-blender.htmlAttachments:
You must be logged in to view attached files.Technical Artwork Specialist@TBL.nl
2021-03-18 at 12:53 pm #39563Ivan LyubovnikovStaffHi 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.
2021-03-18 at 12:57 pm #39564sirhcCustomerAwesomely quick reply!!!
I’m gonna check it out!!
Super tnx!
Chris———————
WORKED!Technical Artwork Specialist@TBL.nl
-
AuthorPosts
- You must be logged in to reply to this topic.