Graphics oposit direction

Hi volks

I use the graphic rect-outline-colored node and a potentiometer ( &display st7735). If I conect both together and multiply the high, I get a positve value. I use that to change the high value of the rectangel and it works fine for me. But how to change the direction of the rectangel? It’s go out of my display and dont rised up.
I also tried it with a negative valeu but that dosent work.
What is the solution to change the direction?
Can that be change into the node c++??

I’m not sure I understand what you are asking, but it sounds like you want to use negative values for hight to have it “grow” down instead of up.

If the library you are using does not support negative numbers for hight, you can work around that by adding hight to y if hight is negative (moving the rectangle down will be the same result as “growing” it down). You would then use the absolute value of h for the hight of the moved rectangle.

If you are using POT input to get hight, it will be a value between 0 and 1. You will want to map this to the range you want to allow for hight (maybe -100 to 100, for example).

I understand what you mean with the library. But let me show you an exampel what I exacly mean and what happen.
The white line is 0 so the rectangel should grove to the direction of green arrow if I change the high value, but it takes the opposit way to the red one.

It goes down instead of high, that is what I mean with wrong direction and why I try negative value. (Please ignore the negative values)

Just a guess…is the upper-left corner the 0,0 coordinate? That would mean increasing Y is going down on the screen (the opposite of drawing a graph). You can still use the technique I mentioned above, subtracting height from y to move it up the screen and expand down rather than expecting it to expand up.

1 Like

Your guess was right, the upper left corner was 0,0. I have implemented your suggestion and it works well. I also had to change something in the graphics, but now it looks good and works as it should.

Thanks for your support!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.