+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Laser Pointer Receiver Distance

  1. #1
    Wire Noob sharpish's Avatar
    Join Date
    Jul 2010
    Posts
    10

    Default Laser Pointer Receiver Distance

    I was wondering if anyone can help me. I've seen on tutorials how to link up the LPR to the x, y, z and distance to screens. However on my LPR and on gmod wiki it shows
    x
    y
    z
    active
    pos
    ranger data
    I've been playing around now for sometime now trying to get it to display the distance when using the laser pointer, but I can't seem to get it. I've tried using an expression 2 containing pythagorus but still nothing

    I'd love some help because I'd like to try and make a laser targeting cannon using projectiles

  2. #2
    Wire Sofaking jacoby6000's Avatar
    Join Date
    Feb 2008
    Location
    behind you when you aren't looking
    Posts
    792

    Default Re: Laser Pointer Receiver Distance

    to get distance, just take the point that the laser is hitting (pos) and the point that you want to get its distance from, then run V:distance(V)

    EDIT: 555th post
    Last edited by jacoby6000; 07-10-2010 at 03:10 PM.
    Quote Originally Posted by Garrysmod View Post
    Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
    I'm not stupid!
    In [his] experience that was a sentence never to be uttered except to prove its own inaccuracy
    --Orson Scott Card

  3. #3
    Wire Noob sharpish's Avatar
    Join Date
    Jul 2010
    Posts
    10

    Default Re: Laser Pointer Receiver Distance

    Thanks

    So I'm after the distance between the receiver and where the laser pointer is hitting

  4. #4
    Wire Sofaking jacoby6000's Avatar
    Join Date
    Feb 2008
    Location
    behind you when you aren't looking
    Posts
    792

    Default Re: Laser Pointer Receiver Distance

    get the recievers position using an entity marker
    Code:
    @inputs Receiver:entity Pos:vector
    @outputs Distance
    Distance = Receiver:pos():distance(Pos)
    or use a wirelink
    Code:
    @inputs Receiver:wirelink
    @outputs Distance
    runOnTick(1)
    LaserPos = Receiver["Pos",vector]
    ReceiverPos = Receiver:entity():pos()
    Distance =  ReceiverPos:distance(LaserPos)
    Quote Originally Posted by Garrysmod View Post
    Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
    I'm not stupid!
    In [his] experience that was a sentence never to be uttered except to prove its own inaccuracy
    --Orson Scott Card

  5. #5
    Wire Sofaking Azrael's Avatar
    Join Date
    Aug 2007
    Posts
    1,946

    Default Re: Laser Pointer Receiver Distance

    Either place a GPS receiver right next to the receiver, or use a target finder next to the laser pointer receiver to find its GPS coordinates (you could also use an entity marker and a gate that gives the position).

  6. #6
    Wire Noob sharpish's Avatar
    Join Date
    Jul 2010
    Posts
    10

    Default Re: Laser Pointer Receiver Distance

    Cheers, great help

  7. #7
    Wire Noob sharpish's Avatar
    Join Date
    Jul 2010
    Posts
    10

    Default Re: Laser Pointer Receiver Distance

    I've not had any luck with the expression

    This is what I'm aiming for File:Laserpointer.jpg - GMod Wiki

    How would I use the GPS Azrael? I've only ever used it with a Target Finder for a missile

  8. #8
    Wire Noob danielpower's Avatar
    Join Date
    Jul 2010
    Posts
    2

    Default Re: Laser Pointer Receiver Distance

    Your explanation of 300mw green laser pointer also helped me ,thanks a lot.
    Last edited by danielpower; 08-03-2010 at 09:15 AM.

  9. #9
    Wire Noob sharpish's Avatar
    Join Date
    Jul 2010
    Posts
    10

    Default Re: Laser Pointer Receiver Distance

    Does anyone know why 'Distance' was removed from the laser pointer receiver?

  10. #10
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Laser Pointer Receiver Distance

    Can't you just wire a ranger distance gate to the "ranger data" output? Alternatively:
    Code:
    @inputs R:ranger
    @outputs Dist
    interval(->R)
    Dist = R:distance()
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

+ Reply to Thread
Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots