HISE Logo Forum
    • Categories
    • Register
    • Login

    Rotating pointer on knob issue

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 75 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanHD
      DanH
      last edited by

      I have two pointers in my knob LAF. I want one of them to move to a modulation value (references elsewhere in the script) and one to point at the knob value. However the two g.rotate functions add together to make the bottom one completely out of scale / range.

      How can I separate them from each other in the script?!

      	// White Pointer
      	
      	g.setColour(Colours.white);
      	g.rotate(-2.42 + obj.valueNormalized * 2.42 * 2, Rect.getCentre(obj.area));
      	g.fillRect(Rect.translated(Rect.withSizeKeepingCentre(obj.area, 1.8, 4.8), 0, -11.7));
      
      
      	//Blue Pointer modulating
      	
      	g.setColour(Colours.white);
      	g.rotate(-2.42 + modValue * 2.42 * 2, Rect.getCentre(obj.area));
      	g.fillRect(Rect.translated(Rect.withSizeKeepingCentre(obj.area, 4, 1.4), 0, -16.8));
      

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @DanH
        last edited by

        @DanH The first time you rotate the canvas you are starting from 0, the second time you are starting from the first rotation. So I think (I'm just guessing) you need to rotate back to 0 before you make your second rotation - or you need to account for the first rotation in the calculation of the second.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @d.healey
          last edited by

          @d-healey said in Rotating pointer on knob issue:

          or you need to account for the first rotation in the calculation of the second.

          Perfect, thanks!

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          19

          Online

          1.7k

          Users

          11.8k

          Topics

          102.6k

          Posts