At the moment I'm trying to make something like a spotlight that swings from side to side. I've managed to get it to swing in one direction but I am not sure how to get it to not look so jittery or make it change directions. Thanks!
ItsJustRyan wrote: ↑June 2nd, 2021, 6:21 pm
I've managed to get it to swing in one direction but I am not sure how to get it to not look so jittery or make it change directions.
Replace the Formula option of the [MeasureRotate] measure with the following one: Formula=(( MeasureRotate > 0 ) ? ( MeasureRotate - 1 ) : 49 ).
balala wrote: ↑June 2nd, 2021, 7:09 pm
Replace the Formula option of the [MeasureRotate] measure with the following one: Formula=(( MeasureRotate > 0 ) ? ( MeasureRotate - 1 ) : 49 ).
Would i use an if statement or something similar to make it alternate between the two? Thanks!
balala wrote: ↑June 2nd, 2021, 7:09 pm
Replace the Formula option of the [MeasureRotate] measure with the following one: Formula=(( MeasureRotate > 0 ) ? ( MeasureRotate - 1 ) : 49 ).
If I understand (i mightn't btw), the same formula concept can be used for the reverse direction:
Formula=(( MeasureRotate < 50 ) ? ( MeasureRotate + 1 ) : 1 ) This may be really wrong so wait for balala to confirm or correct
CodeCode wrote: ↑June 2nd, 2021, 8:14 pm
If I understand (i mightn't btw), the same formula concept can be used for the reverse direction:
Formula=(( MeasureRotate < 50 ) ? ( MeasureRotate + 1 ) : 1 ) This may be really wrong so wait for balala to confirm or correct
It's correct, but it's not needed. The original formula (Formula=(MeasureRotate % 50) + 1), used by ItsJustRyan is good enough and much simpler. When the value has to decrease this doesn't work, but one possible solution is the formula I proposed.
balala wrote: ↑June 2nd, 2021, 8:31 pm
It's correct, but it's not needed. The original formula (Formula=(MeasureRotate % 50) + 1), used by ItsJustRyan is good enough and much simpler. When the value has to decrease this doesn't work, but one possible solution is the formula I proposed.
The thing is it goes anticlockwise and then jumps back rather than constantly switching unlessi mucked something up lol.
CodeCode wrote: ↑June 2nd, 2021, 8:42 pm
I think you need another condition or match test for the min/max of the two formulas and change each way accordingly.
so a calc measure with an if statemnt checking if it reached/is greater than a certain angle and set a variable to 1 or 0 which governs another if statement deciding which formula to use?
ItsJustRyan wrote: ↑June 2nd, 2021, 8:44 pm
so a calc measure with an if statemnt checking if it reached/is greater than a certain angle and set a variable to 1 or 0 which governs another if statement deciding which formula to use?
ItsJustRyan wrote: ↑June 2nd, 2021, 8:44 pm
so a calc measure with an if statemnt checking if it reached/is greater than a certain angle and set a variable to 1 or 0 which governs another if statement deciding which formula to use?
The test to reverse direction can be added to the existing rotate measure.
Notes: I changed the skin update to the fastest possible rate of 16 milliseconds and used a smaller image (330x220) to test.
I also commented out the full screen shape that prevented desktop interactions.
Test image:
TriangleSL2.png
Aside: I am not sure how happy you will be using large images and fast updates; This is going to eat up a lot of CPU cycles!
arc50.gif
You do not have the required permissions to view the files attached to this post.