lol4you2
|
  |
| Joined: 27 Apr 2010 |
| Total Posts: 337 |
|
|
| 10 Oct 2015 04:10 PM |
| I got a radar, and I want that line wich rotates around the center. I can't get the line to rotate around the center! |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 10 Oct 2015 04:15 PM |
| not only do none of us have any clue what "that line wich rotates around the center" is, but also this post doesn't contain a question |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2015 04:18 PM |
*kid posts something he wants about lines and assumes it is math stuff
The mentality amuses me |
|
|
| Report Abuse |
|
|
Curosity
|
  |
| Joined: 18 Aug 2010 |
| Total Posts: 1085 |
|
|
| 10 Oct 2015 04:19 PM |
Here, this will answer your question:
https://www.youtube.com/watch?v=dQw4w9WgXcQ&list=RDdQw4w9WgXcQ |
|
|
| Report Abuse |
|
|
lol4you2
|
  |
| Joined: 27 Apr 2010 |
| Total Posts: 337 |
|
|
| 10 Oct 2015 04:23 PM |
| ok so I just want something like minute hand on an analog clock(in a GUI), and I need someone to help me with that. sorry, I hope this is clear enough :) |
|
|
| Report Abuse |
|
|
Curosity
|
  |
| Joined: 18 Aug 2010 |
| Total Posts: 1085 |
|
|
| 10 Oct 2015 04:24 PM |
| uhhh.... Do you know what CFrame is? Scripting is? School is? |
|
|
| Report Abuse |
|
|
Curosity
|
  |
| Joined: 18 Aug 2010 |
| Total Posts: 1085 |
|
|
| 10 Oct 2015 04:24 PM |
| That was kinda rude. Sorry. here you go, this is a video tutorial on it. https://www.youtube.com/watch?v=dQw4w9WgXcQ |
|
|
| Report Abuse |
|
|
TealTeam
|
  |
| Joined: 06 Jan 2015 |
| Total Posts: 720 |
|
|
| 10 Oct 2015 04:24 PM |
| You guys are so rude, his question was perfectly fine. |
|
|
| Report Abuse |
|
|
Curosity
|
  |
| Joined: 18 Aug 2010 |
| Total Posts: 1085 |
|
|
| 10 Oct 2015 04:25 PM |
| Wait but why is the title math stuff? This has nothing to do with math? |
|
|
| Report Abuse |
|
|
TealTeam
|
  |
| Joined: 06 Jan 2015 |
| Total Posts: 720 |
|
|
| 10 Oct 2015 04:36 PM |
| It actually does. Rotation is math, is it not? |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 17 Oct 2015 10:45 AM |
well, i can start you off. you'll need to make a billboard GUI on a part. i may be outdated and whatnot because i don't attend this site often, but to my knowledge and research, there is no clearcut way to make a line on a GUI. so, make your frame and whatnot
i wrote a script back in the day called the rudiject library that generated a large variety of geometrical shapes. i used bresenham's line algorithm to produce a basic line:
['line'] = function(frame, x1, y1, x2, y2, name) -- Based upon Bresenham's Line Algorithm. -- Non-optimized. name = name or 'Line'..rudiject.properties.cyclic Instance.new('Frame', frame).Name = name deltax, deltay = 2*(x2 - x1), 2*(y2 - y1) ix, iy = deltax/math.abs(deltax), deltay/math.abs(deltay) rudiject.classes.point(frame[name], x1, y1) if (deltax >= deltay) then error = deltay - deltax / 2 while x1 ~= x2 do if ((error >= 0) and ((error ~= 0) or (ix > 0))) then error = error - deltax y1 = y1 + iy end error = error + deltay x1 = x1 + ix rudiject.classes.point(frame[name], x1, y1) end else error = deltax - deltay / 2 while y1 ~= y2 do if (error >= 0) and ((error ~= 0) or (iy > 0)) then error = error - deltay x1 = x1 + ix end error = error + deltax y1 = y1 + iy rudiject.classes.point(frame[name], x1, y1) end end end,
this was another that i used to produce a line using xiaolin wu's algorithm. this is actually anti-aliased, so it'll probably look better. http://pastebin.com/ZwADjyqb
clearly, using those alone isn't going to work, so optimize it so that it's not using all the (now nonsensical) 'rudiject' stuff. you have to enter a starting point and the terminal point, so there's a bit more to it than just specifying the time. the clock is probably going to work in intervals of pi/6, to determine the point (x2, y2), you'd use the formula
(x2,y2) = (radius * cos(math.pi/2 - [value dependent on time]), radius * sin(math.pi/2 - [value]))
where the radius is the length of the minute hand
i can explain more, but this is just a general analysis |
|
|
| Report Abuse |
|
|