Cockos Incorporated Forums API: gfx.arc is 90 degrees off
 Register Track Bugs/Feature Requests Search Today's Posts Mark Forums Read

 01-16-2017, 08:57 PM #1 Lokasenna Human being with feelings     Join Date: Sep 2008 Location: The vast, frozen wasteland of western Canadia. Posts: 4,179 API: gfx.arc is 90 degrees off gfx.arc isn't using the same reference angle as Lua's trig functions. The lines in the image below were drawn using the same angle as the arc's endpoints. As you can see, the arc is 90 degrees away from where it should be. It's not a difficult thing to fix - just add 0.5 to the rad values when you draw an arc - but it's a prime candidate for the Nitpick forum. If we'd rather not fix it due to the havoc it would wreak on existing scripts, at minimum I'd like to see a note added to the API documentation so nobody else has to waste an hour figuring out why their code was all messed up like I just did. Cheers. Code: ```local name, w, h = "", 258, 258 local x, y = reaper.GetMousePosition() x, y = x - (w / 2) - 8, y - (h / 2) - 30 local ox, oy = w / 2, h / 2 local angle_a = -0.25 * math.pi local angle_b = 0.25 * math.pi local r = 96 function Main() local quit = gfx.getchar() if quit == -1 or quit == 27 then return 0 end gfx.set(0.2, 1, 0.2, 1) local ax = ox + r * math.cos(angle_a) local ay = oy + r * math.sin(angle_a) gfx.line(ox, oy, ax, ay) local bx = ox + r * math.cos(angle_b) local by = oy + r * math.sin(angle_b) gfx.line(ox, oy, bx, by) gfx.set(1, 0.2, 0.2, 1) gfx.arc(ox, oy, r, angle_a, angle_b, 1) reaper.defer(Main) gfx.update() end gfx.init(name, w, h, 0, x, y) Main()``` __________________ Default 5.0 Nitpicky Edition / GUI tutorial for Lua / Theory Helper / Radial Menu / Donate / ReaPack Last edited by Lokasenna; 01-16-2017 at 09:11 PM.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General Discussion     General Discussion (aka spam trap) REAPER Forums     REAPER General Discussion Forum     REAPER OS X Forum     REAPER Color Themes and Icon Sets     REAPER Q&A, Tips, Tricks and Howto     REAPER Compatibility     REAPER Bug Reports     REAPER Feature Requests     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     Dstruct's Casa De Nitpicks     Recording Technologies and Techniques     MIDI and other music/audio protocols     JSFX and ReaScript Discussion     REAPER Music/Collaboration Discussion     newbieland     REAPER Developer Forum     REAPER Pre-Release Discussion     REAPER lounge NINJAM Discussion     User Discussion     NINJAM Developer Discussion Cockos and Friends Software Discussion     WDL users forum     LICEcap Discussion     SnapEase Discussion     OSCII-bot forum     PathSync Discussion     Assniffer Discussion     TunnelVision Discussion     LanMon Discussion     Debris Discussion     Wifight Discussion     The Camel Farm     Stashbox & Shup

All times are GMT -7. The time now is 03:23 AM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top