Raised This Month: $51 Target: $400
 12% 

Find the point x units away from player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 01-20-2018 , 06:04   Find the point x units away from player
Reply With Quote #1

How to find the point "x" units away through player's aim vector(where player looking at).

So if i find the unit vector i can simply multiply with "x" and add it to player origin right ?
How to do it? Can you give simple examples

Edit: Found it
Code:
// user's view angle
    pev( id, pev_v_angle, fAimVector )
    
    // vector pointing in that direction
    angle_vector( fAimVector, ANGLEVECTOR_FORWARD, fAimVector )
    
    // user's origin
    pev( id, pev_origin, fPlayerOrigin )
    
    // lengthen vector and move it to user's origin
    fAimVector[0] = fAimVector[0] * 9999.0 + fPlayerOrigin[0]
    fAimVector[1] = fAimVector[1] * 9999.0 + fPlayerOrigin[1]
    fAimVector[2] = fAimVector[2] * 9999.0 + fPlayerOrigin[2]
__________________
Quote:
Originally Posted by wickedd View Post
Make me or STFU boy

Last edited by pupdebox; 05-22-2018 at 09:05.
pupdebox is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-20-2018 , 12:18   Re: Find the point x units away from player
Reply With Quote #2

this might be it: https://forums.alliedmods.net/showthread.php?p=2557957
__________________
retired chump

Last edited by DjSoftero; 01-20-2018 at 12:18.
DjSoftero is offline
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 01-20-2018 , 23:22   Re: Find the point x units away from player
Reply With Quote #3

wowie that link helped me alot thank you <3 good to see alternative versions of it
__________________
Quote:
Originally Posted by wickedd View Post
Make me or STFU boy
pupdebox is offline
Reply



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 Jump


All times are GMT -4. The time now is 19:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode