Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Simple rotate button

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
recordbay
Posts: 3
Joined: 12 Oct 2016, 15:41

Simple rotate button

Post by recordbay » 14 Oct 2016, 16:37

Hi,

I am learning ventuz, and cannot figure out how to accomplish this simple task.

lets say i want to rotate a cube everytime I click on a circle. right now i am using a "touch button" assign to the circle to increment in 30 degrees the angle.(attached image, node on the top to the Main axis)

the problem is that whenever i release the mouse button, the angle goes back to the original amount, and i want to actually add 30 degrees everytime I press click on a object.

thank you!
Attachments
screen_ventuz2.png

User avatar
lerou
Posts: 345
Joined: 06 Sep 2013, 07:14
Location: Hamburg, Germany

Re: Simple rotate button

Post by lerou » 17 Oct 2016, 10:08

You're using the prssed flag I guess. That will snap back to 0 once you release the mouse. Use the "single tap".

If you want to step 30! at a time, use a counter, bind the forward event to the single tap, put the result through your expression, use a damper to get a nice animation. See vza.

If you want a full 360° (or something similar that ends with the same state that it starts with) use a mover in "one shot" mode. See vza.

Buuut... I wouldn't recommend using "single tap". On tough screens this makes problems whenever the touch is not exact enough. A slight movement of the finger will be considered a swipe, not a single tap. So I usually use the "touch pressed" flag and throw that into an event and use that. See vza ;)

Just have a look at the samples in the vza, they are pretty straight forward.

Cheers,
rou
Attachments
rotate.vza
(12.8 KiB) Downloaded 185 times

recordbay
Posts: 3
Joined: 12 Oct 2016, 15:41

Re: Simple rotate button

Post by recordbay » 20 Oct 2016, 13:37

cool ! thank you!

How can i make the same, but using a 2D layer as the button (so that whenever i animate my camera....the button stays there)? the examples have always large groups of containers...one for PAGES and other for UI. i cannot see trough how they are connected to each other.

Post Reply