Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

smooth panel rotations following the mouse and taking into account the speed of movement

Looper

New member
Joined
Oct 6, 2020
Messages
3
Reaction score
0
Points
0
Hello everyone, I really want the rotations to follow the mouse and take into account the speed for the panels in the GUI menu. I tried everything but I couldn't do it. I really hope that you can help me. You can see an example of this in the video... https://skr.sh/vG5T1OdyM4U?a
 
Hello everyone, I really want the rotations to follow the mouse and take into account the speed for the panels in the GUI menu. I tried everything but I couldn't do it. I really hope that you can help me. You can see an example of this in the video... https://skr.sh/vG5T1OdyM4U?a
If your ClickGUI is modular it will make this much more simple.

Assuming each category is rendered independently you could start at mouseDragClick() since this is where the dragging begins. You have to save the start position and use trigonometry to determine at what angle it should rotate. You also will want to cap the angle so it doesn't keep rotating as it gets dragged. There's plenty of tutorials online about basic trigonometry and glTransform and glTranslate which is all you need.

You could use the same logic for animating other things like easings to smoothen the rotationAngle.
 
If your ClickGUI is modular it will make this much more simple.

Assuming each category is rendered independently you could start at mouseDragClick() since this is where the dragging begins. You have to save the start position and use trigonometry to determine at what angle it should rotate. You also will want to cap the angle so it doesn't keep rotating as it gets dragged. There's plenty of tutorials online about basic trigonometry and glTransform and glTranslate which is all you need.

You could use the same logic for animating other things like easings to smoothen the rotationAngle.
If suddenly you have nothing to do, I will gladly accept your help hahahaha
 
If suddenly you have nothing to do, I will gladly accept your help hahahaha
He has already explained more than enough to know how to do it. If you are still not able to code it, just learn programming before making a own minecraft client...
 
If suddenly you have nothing to do, I will gladly accept your help hahahaha
Read the docs that MasCauzBad sent, you won't get anywhere with this until you do. And how about you think about what you're doing before trying? It's clear you just want someone to do it for you and you don't care to actually learn shit. It's not even that difficult, just get mouse movement offsets, set a rotation value with it, and then use gl to rotate the selected category. If you don't understand how to do it then spend some time actually fucking reading up on it
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top