Recent

Author Topic: Knob Finger Spinner Graphic Help  (Read 1053 times)

SandyG

  • Full Member
  • ***
  • Posts: 106
Knob Finger Spinner Graphic Help
« on: February 26, 2025, 05:11:08 am »
Trying to spruce up a spinner knob with a finger hole for the spinner.

Tried messing with some of the Phong shading but gave up. Any easy way to code up something that looks like an indented circle?

Picture shows the black finger slot for spinning, but could do better I'm sure.

Sandy


SandyG

  • Full Member
  • ***
  • Posts: 106
Re: Knob Finger Spinner Graphic Help
« Reply #1 on: April 20, 2025, 06:45:22 am »
Made some headway on the Spinner component. Added a lot of drawing features. Cleaning up code before submitting it to github.

A couple of pics of styles it can do.

circular

  • Hero Member
  • *****
  • Posts: 4407
    • Personal webpage
Re: Knob Finger Spinner Graphic Help
« Reply #2 on: April 20, 2025, 01:40:05 pm »
That's pretty cool.

I suppose it could make sense to create a height map of the 3D shape (half-sphere knob shape and reverse half-sphere for the finger hole).

Though filling a cercle with a gradient is a sensible approach. You can get a more spherical feel by moving the center of the gradient (not aligned with the circle).

Regards
Conscience is the debugger of the mind

SandyG

  • Full Member
  • ***
  • Posts: 106
Re: Knob Finger Spinner Graphic Help
« Reply #3 on: April 22, 2025, 12:40:58 am »
Was thinking of moving the center, but then the finger hole would need to be drawn each time as the knob spins to keep the light angle looking good.

This way it's just rendered 1 time and buffered as it spins, so low CPU/Video use as it moves.

Going to try to clean up last bits, and make a push back into the repo... see how that goes :)

Sandy

SandyG

  • Full Member
  • ***
  • Posts: 106
Re: Knob Finger Spinner Graphic Help
« Reply #4 on: April 23, 2025, 07:55:18 pm »
Well, looking at the Position indicator (Finger/Lines etc.) I do draw them on any movement so changing the angle of the finger hole gradient would not be that much trouble I guess. Will have to look at that.

Going to make an attempt at an autosize option as it likely is a good thing to scale things based on if the LCL magic of resize based on DPI/Scale happens. So going to take a bit of time to see if I can sort that out before committing to github. Will be nice if it can work like other components and just work ;)

Sandy

circular

  • Hero Member
  • *****
  • Posts: 4407
    • Personal webpage
Re: Knob Finger Spinner Graphic Help
« Reply #5 on: April 23, 2025, 10:15:44 pm »
Ok, that's cool. If you're looking for information, feel free to ask. I guess you're likely to need a gradient from BGRAGradients and use it as texture parameter.

It is a great idea as well to take into account scaling. This is becoming quite common to have something else than 96 DPI.

Cheers
Conscience is the debugger of the mind

SandyG

  • Full Member
  • ***
  • Posts: 106
Re: Knob Finger Spinner Graphic Help
« Reply #6 on: April 26, 2025, 06:40:13 am »
Got auto scaling of the Spinner working pretty well.

Did the dreaded Github PR see how that goes  :)

Should be able to build the test program once the new package is built. Let me know if you find anything!

Thanks

Sandy

« Last Edit: April 26, 2025, 06:42:31 am by SandyG »

circular

  • Hero Member
  • *****
  • Posts: 4407
    • Personal webpage
Re: Knob Finger Spinner Graphic Help
« Reply #7 on: April 26, 2025, 09:03:20 am »
Thank you very much SandyG for making a beautiful PR. I understand it can be a bit intimidating but you're handling it pretty well already :)

I will check the component on various platforms.  :)
Conscience is the debugger of the mind

SandyG

  • Full Member
  • ***
  • Posts: 106
Re: Knob Finger Spinner Graphic Help
« Reply #8 on: April 26, 2025, 06:02:01 pm »
Mostly intimidating as to not screw up someone else work or make extra work for others cleaning! Getting better with Git, been using a tool called SmartGit, but it's only as smart as the user!

Will take a look at the reverts on the Makefile etc.

See how that goes.

Thanks always for the help

Sandy

 

TinyPortal © 2005-2018