Image carousel : Images orbiting (left or right) round the pivot on mouse movements

Hi Everyone,

I am trying to create an image carousel in 3d world. So my requirement is to move images either left or right, and it should be moving round the pivot only. I came up with this structure and it seems only camera is moving not the images.

I am struggling with the carousel effect (image movement either left or right on mouse move). I checked and tried few examples & questions but those are for single mesh so not related to my requirement.

It would be really grateful if someone can help me on this.
Thanks

1 Like

I wonder loud (i like wondering loud :slight_smile: ) - what is the difference in that instance? Seems like it is working as you would expect. What is the difference between moving the camera to rotating the mesh, if all you have in the scene is the carousel?

Also, you have an arcRotateCamera with a camera.attachControl(canvas, true); , which by default will enable camera rotation on mouse move :slight_smile:

@RaananW
When I refer to moving of camera, I mean camera revolving around the mesh. Its more like you are sitting on moon and watching earth :smile:.

See this example, the mesh is moving when we pick and drag, not the camera.

This is for single mesh but I am looking for similar kind of behavior when I pick and drag over bunch images.

@carolhmj
Yes you are correct, If I remove camera.attachControl(canvas, true); then no camera movements, but still I am unable to move images in circular motion.

I do understand the difference between the two, but I don’t understand what the difference is in your use case. Unless this is a part of a larger scene (which can be an obvious answer to my question), there is no difference between the two. If you are planning on only implementing an image carousel, there is no difference. So I am just wondering if you even need to move the meshes.

@RaananW
Yes I will be using this carousel within larger scene.

Set a parent for your images at the center of the carousel and rotate the parent with mouse move.

2 Likes

@JohnK
Thanks that works. :slightly_smiling_face:

But can you suggest how to restrict it to move only left or right and not in any other direction or dimension.

Don’t rotate it about x!

4 Likes

@JohnK
You saved my day. :smile:
Thanks

You might want to read

2 Likes