|
Hello there, I'm trying to get an animation similar to what we have in the iOS Widget picker where a view 3D rotates in X and Y in circle, without reverse: I've tried to play a little bit with Anyone sees what I'm missing? P.S. Kudos if you have any input to do the 3D shadow behind it!
|
|
I agree. But by setting it to false, I couldn't find any setting where I could achieve a continuous rotation without any snap at the end of the animation loop. My example above is somehow what I could do at best but without getting the excepted result… |
|
I think you want TWO animations. The first will twist your clock face left and right like an old school radio dial. The trick is you want the twisting and the nodding to both take the same amount of time, for example two seconds. However you want them out of phase with each other by one second. This is where I use the delay(1) modifier. In this manner, as the clock face is fully twisted left, it has zero tilt forward or backwards. This pattern reverses giving you a smooth left to right twist, combined with a smooth back and forth tilt. At least this is what I think you're after. Please report back! Let us know how you solved this!
|
|
Also, check the documentation. The values for x, y, and z axis should be values from zero to one. You've inserted degrees, and some are negative. Not sure why the compiler is not complaining. (Maybe it's me who needs to check the documentation!) |
|
Wow, this is exactly what I was looking for... and didn't execept a whole precise solution like this! The funny thing is that using two Concerning the limits between 0 and 1 for axis values, I noticed the doc but found multiple examples using higher values... but same feeling, not sure why the compiler allows this (and that it actually works). Many thanks for your help @Obelix ! |
|
You noted:
Look at your monitor in front of you. The X Axis would be tilting your monitor backwards to face the ceiling, or forwards to face the keyboard. The Y Axis would be moving the monitor to show someone sitting to your left, or the other way to show someone sitting on your right. The Z Axis would be twisting your monitor from a landscape orientation to a portrait orientation. You could get nice effects from adjusting all three parameters in a 3D Rotation effect. HomeworkHere's a homework assignment! Add three vars to your RotateClockView, one each for X, Y and Z axis. Then add three sliders to your user interface. Allow the user to slide the values from zero to one and update the 3D rotation in real time. Find the three values that like you best! Post your updated code here, please! |
|
Feel free to pick an answer here and mark it as "Solved" This way we don't keep revisiting your question and others might find the answer to a similar question. |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.