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.

tourntable (rotate object, not camera)

Home Forums Puzzles tourntable (rotate object, not camera)

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #79258
    bullx
    Participant

    I would like to rotate my object by dragging the mouse while keeping the camera fixed.
    The effect I am aiming for is a floating object that you can rotate using the mouse.
    Can you drive me with the right puzzle combination?

    #79259
    xeon
    Customer

    You have a couple of options. The most direct is the DragRotate puzzle – https://www.soft8soft.com/docs/manual/en/puzzles/Events.html#drag_rotate

    This will allow the user to click on the 3D object and rotate that object.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79261
    bullx
    Participant

    thank you, but how to enalble the click & drag on the whole screen if I’m not using an object as a background?
    my current wip: https://www.bullx.it/3d/omerwolfdemo

    #79271
    xeon
    Customer

    Well…what you are requesting can be done…the question is it something that will really work for you.

    You could use the HTML puzzles “get event property” and then use the touches.page and then write your logic around monitoring the x and y positions of your cursor and then rotating the object. However, it seems you are trying to create an HTML menu so would have to have a way of ignoring mouse up and down events when clicking the HTML buttons and other logic to support it.

    The other problem you find is that rotating a 3D object can be less performant than moving the camera so depending on your scene, number of triangles, number of objects, redraws, textures sizes…etc. this may be more than some devices can handle but you will have to determine that.

    Then there is the general user experience when navigating these sort of webgl demos, people are used to navigating and spinning a camera (they don’t think of it is a camera)….so doing other things (if not an FPS game or game function like) the users will feel a bit lost.

    If your goal is to keep the lighting and the background consistent as the object is rotated, there are ways to solve that too.

    I have seen another approach too…which is placing a transparent 3d plane in front of the object you want to rotate…making the plane the size of the view port and then assigning the drag rotate to that plane to rotate the object. There are issues with this approach to and I don’t recommend it either.

    I do recommend finding a way to use the camera to your advantage.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79273
    bullx
    Participant

    Thanks for your reply, very interesting.
    What I’d like to achieve is for the reflections on the object’s surface to move as it is rotated, so I’d like the HDR and the object not to move together as one.
    It would be perfect if I could link the HDR to the camera.
    Thanks again for the help!

    #79282
    xeon
    Customer

    So you are wanting the camera and environment HDR to not move and the object to move so the reflections move through the object you are rotating. What you may find more efficient is to create a reflection map and animate the UV map do it runs across the object.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79292
    bullx
    Participant

    EXACTLY, can you give me some hints on which puzzle should I use to animate the reflection map?
    thank you

    #79293
    xeon
    Customer

    I obviously do not know your scene or project but in most cases moving the camera does the exact same thing as described above. However if you have stationary camera and a stationary background and you want the object to rotate and have reflections update…. you can try
    1. Use a reflection plane on your object – then drag move the object as needed.
    2. Create a reflection texture. Map it to your object. Then using use Value nodes in your reflection shader and animate the UVs using the animparameter puzzle. This would be more performant. When you create the DragMove on your object..animate your UVs of the reflection map. Since this is a turn table every degree of object rotation is a negative degree of rotation for the UV Map.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79298
    bullx
    Participant

    please have a look HERE
    the glass works as expected, but the smooth curved lines on the mask have “fixed” reflections (see hilight spot in the attached image).
    I would like to see hilights to move on the surface when rotating the view the same way it happen with the glass.

    Attachments:
    You must be logged in to view attached files.
    #79359
    xeon
    Customer

    After watching your demo it seems your highlights in your materials other than the glass are “mapped” or baked as textures rather than highlights from sources from either lights or the HDR background.

    The problem is not the camera or the background its that the textures for the materials in your scene are not setup in a way they can react to the light in the scene.

    Here is a simple demo. That uses the standard orbit camera and a simple torus and glass type insert. https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:f2f27a4091/X3L_materialsetup/X3L_materialsetup.html

    For the torus I have used to materials…one for the flatter / rough surface and a glossy ring that when you rotate the camera you can see the reflections interacting correclty like the glass.

    You will must need to rebuild the red and black shaders so they work correctly.

    Project Zip with blend file located here: https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:f2f27a4091/X3L_materialsetup.zip

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79418
    bullx
    Participant

    thank you very much.
    Can you help me to understand what is wrong in my setup?

    • This reply was modified 1 month ago by bullx.
    Attachments:
    You must be logged in to view attached files.
    #79425
    xeon
    Customer

    I would need the blend file at a minimum, full v3d project with blend file at most.
    You can reach me directly at xeons3dlab[at]gmail[dot com]

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79460
    xeon
    Customer

    File received. Solution found.
    Turns out the camera in the scene was corrupt on some level. I have not figured what the exact issue is or whether it was a setting…Still digging into that but.

    The solution was to create a new camera … and all is working properly.

    Email with fixed blend file has been sent.

    Update: the camera in your original file has a “Cycles api script attached” under custom properties for the camera. Removing it doesn’t affect anything but could cause the camera to not function properly in V3D. If you are using a plugin or something that is adding that…try removing or not using it and see if your cameras work properly.

    • This reply was modified 1 month ago by xeon.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79468
    bullx
    Participant

    thank you Xeon for solving the issue.
    it works as expected now.
    regards.

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