- This topic has 23 replies, 4 voices, and was last updated 10 months, 1 week ago by xeon.
-
AuthorPosts
-
2024-02-16 at 3:52 am #70688vergecuriousCustomer
Hi all,
I have the puzzle below to drag rotate the scene in my simulation. I’m looking to do the following.
1. control the speed of the drag.
2. limit the rotation of the drag.
3. return the scene to the home (beginning positon) whe you release the mouse button
Any help will be appreciated.Attachments:
You must be logged in to view attached files.2024-02-16 at 4:15 am #70690xeonCustomerOk just to be clear … you want to drag over your scene to rotate it vs rotating the camera?
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-02-16 at 4:47 am #70692vergecuriousCustomerI already have a on click event for a 360 degree camera rotation around my primary object. I want the user to be able to rotate the entire scene by draging the mouse. Is rotating the camera better? I’m open to what is best.
2024-02-16 at 4:49 am #70693vergecuriousCustomerIf you want to view the simulation, see below.
https://3dimensionaltooling.com/3d%20web%20content/working%20syil%20X7/my_awesome_app.html
2024-02-16 at 5:40 am #70694xeonCustomerIts exceedingly rare I would suggest rotating a scene vs rotating the camera. Its easier to implement and its much more efficient and user friendly.
The camera you want to use is an orbit camera which you are doing now.
You can set the speed at which it rotates in the your Camera Properties Verge3D settings..there will be a rotation speed control value you can set.There are also vertical and horizontal rotation min and max limits you can set in the same panel.
The only thing that you will have to write some puzzles for is the return to home after the mouse is let up after drag is done….but you are not going to use the drag puzzle.
This can be done with a Tween camera from current position to your home position with the type set to spherical vs linear.
You will need to use a Camera Target and a Camera Start Location (usually empties) marking these locations and then just tween to them once the camera (stops moving).
What you can do is test the position of the camera using Get Object location (camera) and determine if its changed values in a given duration of X seconds. If the value hasn’t changed then you start the tween if it has then you don’t tween. Simple timer with an interval set to X. I would recommend killing the timer after you return back to the home position.
Other things to consider:
Your HDR image Neutral_Pop.hdr is 10,000 x 5000. This is excessively large and should be something much smaller.
You also have this problem with Foam color and wall tile normal…both of which are 4096×4096.You are also using non Power of Two image sizes for decals etc. I would recommend putting all those textures into one POT image atlas.
Your poly count is high and you are using a light. So your poly count is higher than it needs to be sitting at 3,867,480. Since you have an HDR background you should be able to ditch the light and improve performance. If you want the light effects and shadows you would be better served baking those in the maps … for efficiency sake.
3D text – doesn’t work on Apple Intel based systems….just fyi.
Hope this is helpful.
- This reply was modified 10 months, 1 week ago by xeon.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-02-16 at 6:31 pm #70725diederikParticipantWhat you can do is test the position of the camera using Get Object location (camera) and determine if its changed values in a given duration of X seconds. If the value hasn’t changed then you start the tween if it has then you don’t tween. Simple timer with an interval set to X. I would recommend killing the timer after you return back to the home position.
hi Xeon, could you eleborate how this approach works in puzzles? I’ve been trying to work out such a solution but haven’t succeeded so far..
2024-02-16 at 6:50 pm #70726kdvParticipantYou want to rotate the entire scene instead of using Orbit controls?
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.
2024-02-16 at 8:50 pm #70728vergecuriousCustomerAll I want is to be able to rotate either the camera or scene to view about 120 degrees in each direction horizontally with a mouse drag.
2024-02-16 at 8:53 pm #70729vergecuriousCustomerThank you for your in depth comments. I now have three cameras. I have one for the drag. One for the zoom and one for the rotation. I’m able to lock a camera vertically but not horizontally. Not sure what is going wrong. No matter the setting I have 360 degrees of rotation.
2024-02-16 at 9:00 pm #70731kdvParticipant~4 millions tris are too much for this scene
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.
2024-02-16 at 9:30 pm #70734xeonCustomerHere are two options to choose from if you really want to drag rotate the object to make your scene move. The traditional way of doing this is the way KDV has outlined above.
I personally prefer option 2.
demo: https://v3d.net/t3v
Zipfile with blend file:https://v3d.net/t40Overview:
The scene has a large box representing the walls and floor. Box is single sided with normals flipped. I was being lazy.In the center of the box is Suzanne. Inside Suzanne is an Empty called Cam_Target. The starting position of the camera has an Empty called Cam_Start_Location. The Camera is parented to the Cam_Target. This allows the rotation of the Cam_Target and the camera will orbit correctly around the Suzzanne and the room.
Additionally there are Rotation constraints on the Cam_Target they are set to -30 and 30. You can set them up however you want.
I provided two puzzle options. Option 1 is super simple and Option 2 provides you more control.
You can learn more about them here: https://www.youtube.com/watch?v=Fvz1CZleReE
- This reply was modified 10 months, 1 week ago by xeon.
- This reply was modified 10 months, 1 week ago by xeon.
Attachments:
You must be logged in to view attached files.Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2024-02-16 at 9:59 pm #70739vergecuriousCustomerYeah, that’s what I thought. It doesn’t work.
Attachments:
You must be logged in to view attached files.2024-02-16 at 10:10 pm #70741kdvParticipant0 and 0 will not work. it’s the same as 0 and 360 use -xx and +xx.
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.
2024-02-16 at 10:14 pm #70742vergecuriousCustomerWorking my way up I started with option 1. But the “drag rotate” puzzle does not give me a world option, only local and parent.
2024-02-16 at 10:33 pm #70743xeonCustomerbe sure you are using verge3D 4.5 or higher.
Be sure to use them small blue gear in the drag rotate puzzle and turn on “use space option”Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com -
AuthorPosts
- You must be logged in to reply to this topic.