Results 1 to 10 of 10
  1. #1
    snipwnage2's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    191
    Reputation
    10
    Thanks
    135
    My Mood
    Tired

    more snapline shit

    Hi Basically For My snaplines i want the outline to rotate around as the actual direction of the snapline changes, I keep fucking up the math but I'm Really close at the moment

    Code:
    local origin = v:GetPos();
    snapendx = origin:ToScreen().x;
    snapendy = origin:ToScreen().y;
    snapstarty = ScrH()/2;
    snapstartx = ScrW()/2;
    local offsetx, offsety = SnapRotate();
    if (math.abs(snapendx) < ScrW()*5 && math.abs(snapendy) < ScrH()*5) then
    	surface.SetDrawColor(5,5,5)
    		surface.DrawLine(snapstartx-offsetx, snapstarty-offsety, snapendx-offsetx, snapendy-offsety)
    		surface.DrawLine(snapstartx+offsetx, snapstarty+offsety, snapendx+offsetx, snapendy+offsety)
    	surface.SetDrawColor(color)
    		surface.DrawLine(snapstartx, snapstarty, snapendx, snapendy)
    end
    That's the actual snapline and this is the rotation func()
    Code:
    local function SnapRotate()
    	local _x = snapendx - snapstartx;
    	local _y = snapendy - snapstarty;
    
    	local snapangle = math.deg(math.atan2(_y,_x));
    	
    	if (snapangle > 0 && snapangle < 90) then
    		_snapangle =  90 - snapangle;
    		__snapangle = _snapangle - 90;
    	elseif (snapangle > 90) then
    		_snapangle =  (snapangle % 90);
    		__snapangle = 90 - _snapangle;
    	elseif (snapangle < 0 && snapangle > -90) then
    		_snapangle =  90 - math.abs(snapangle);
    		__snapangle = math.abs(snapangle);
    	elseif (snapangle < -90) then
    		_snapangle =  math.abs(snapangle) % 90;
    		__snapangle = _snapangle - 90;
    	end
    	
    	x = math.sin(math.rad(__snapangle));
    	y = math.sin(math.rad(_snapangle));
    	print(x,y)
    	return x, y;
    end
    It's Functional but not p; I was wondering if any of you guys were capable of getting this shit gud

  2. #2
    MasterKitty's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    22
    ya dude first u gotta quit lua

  3. #3
    D3M0L1T10N's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    1,364
    Reputation
    19
    Thanks
    656
    you are over complicating it
    8:53 PM - Xenomorphic 1 hr 7 min cooldown: So is MPGH only exist so people can c+p from ************* and troll the gmod section?

    [IMG]https://i739.photobucke*****m/albums/xx38/jorroa5990/flatexch2_zpsec96a7e2.gif[/IMG]

  4. #4
    FoldedHam's Avatar
    Join Date
    Jun 2013
    Gender
    male
    Location
    fridge
    Posts
    110
    Reputation
    10
    Thanks
    28
    My Mood
    Hot
    Quote Originally Posted by D3M0L1T10N View Post
    you are over complicating it
    i ovr comiplat u

  5. #5
    snipwnage2's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    191
    Reputation
    10
    Thanks
    135
    My Mood
    Tired
    Quote Originally Posted by D3M0L1T10N View Post
    you are over complicating it
    I want rotating snaplines tho and you could do the rotations on a square but that looks gay circle masterrace.
    Do you know the spicy codes or not?
    Last edited by snipwnage2; 08-06-2015 at 12:41 AM.

  6. #6
    D3M0L1T10N's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    1,364
    Reputation
    19
    Thanks
    656
    Quote Originally Posted by snipwnage2 View Post
    I want rotating snaplines tho and you could do the rotations on a square but that looks gay circle masterrace.
    Do you know the spicy codes or not?
    look at how people do it in meinkraft
    8:53 PM - Xenomorphic 1 hr 7 min cooldown: So is MPGH only exist so people can c+p from ************* and troll the gmod section?

    [IMG]https://i739.photobucke*****m/albums/xx38/jorroa5990/flatexch2_zpsec96a7e2.gif[/IMG]

  7. #7
    iridant's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Location
    Fiji
    Posts
    7
    Reputation
    10
    Thanks
    2
    My Mood
    Yeehaw
    -snipsnipsnip tested didnt work-
    Last edited by iridant; 08-11-2015 at 03:40 AM.

  8. #8
    snipwnage2's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Posts
    191
    Reputation
    10
    Thanks
    135
    My Mood
    Tired
    Quote Originally Posted by iridant View Post
    nigga damn just

    cam Start3D
    renderDrawline (this is an outline)
    renderDrawline
    renderDrawline (so is this)
    cam end3d
    Laughed so hard milk came out my nose

  9. The Following User Says Thank You to snipwnage2 For This Useful Post:

    c0deine (08-10-2015)

  10. #9
    c0deine's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    190
    Reputation
    10
    Thanks
    167
    My Mood
    Aggressive
    how is it so hard to literally use the drawline function and world 2 screen lol

  11. The Following User Says Thank You to c0deine For This Useful Post:

    cdr1za (08-11-2015)

  12. #10
    cdr1za's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    86
    Quote Originally Posted by c0deine View Post
    how is it so hard to literally use the drawline function and world 2 screen lol
    it could kill you, you never know.

Similar Threads

  1. [Video] More quality shit metal
    By Reav3R in forum General
    Replies: 5
    Last Post: 08-13-2014, 01:54 PM
  2. [Video] More Random Shit for you [FUNNY SHIT]
    By Dylan in forum General
    Replies: 6
    Last Post: 02-28-2014, 07:34 AM
  3. Shit just got more real.
    By Kallisti in forum General
    Replies: 13
    Last Post: 11-04-2010, 05:35 AM
  4. more shit anime
    By Gourav2122 in forum Anime
    Replies: 5
    Last Post: 04-22-2010, 07:18 AM
  5. Oh shit, no more rocky!
    By Dave84311 in forum General
    Replies: 1
    Last Post: 07-06-2006, 06:20 PM