At first I was thinking that I should create the design and then use some animation with transform,
but I do not think this should work right?
I mean about the 3d feeling.
Should I use three.js maybe?
Or there is a more easy way?
For a basic animation you could rotate a flat image quite easily but it won’t look as good as that 3d demo as obviously you get extra detail as it rotates rather than a flat rotation. However for a simple object it may be good enough.
If you have plenty of time spare (months possibly) you could draw the whole thing in CSS and then you would be able to get a realistic rotation. See this pen (not mine) of a rotated iphone for example that is in pure CSS.
I don’t know much about three.js but it doesn’t look that simple but seems to produce good effects,
I would be inclined to create 3 (or more) static images of the object (front, side and back (if different)) and then sequence between the different images with css to provide the illusion of rotation. In the end it depends on what level of detail you require.
Here’s a basic spin using 2 (stock) images to show the basic effect.
Obviously the back image should be the reverse of the front image to create the proper effect.
I’m thinking that perhaps you could add more planes for the side of the object but not really sure how that would work out. Probably something like this example.
Or it may be easier to simply change the background image in my example in certain steps in the keyframes.
Alternatively scrap all that and just swap between a number of already rotated images (assuming you have those available).
I’m just thinking out loud here so it may be a case of test and see what works best
Ok thank you for your answers I will check everything.
Nice idea with the gif too.
It will need some other moving animation too with this “3d model”.
I will update you more specifically with some videos because it’s hard to explain.
If you are going to have lots of spinny things then I suggest you invest some time in implementing the prefers reduced motion media queries. Then you can swap out the code for static images if the user has specified that they don’t like spinny things