Raised This Month: $ Target: $400
 0% 

Getting a normal vector


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
house
Junior Member
Join Date: Mar 2007
Old 10-20-2007 , 13:51   Getting a normal vector
Reply With Quote #1

I want to get the normal vector for the part of the map that the user is aiming at; this gets me the location:

PHP Code:
public lol(id,level,cid)
{
    new 
orig[3]
    
get_user_origin(id,orig,3)

    ...

    return 
PLUGIN_HANDLED

How could I get the normal vector at that point ?
house is offline
Old 10-20-2007, 15:11
[ --<-@ ] Black Rose
This message has been deleted by [ --<-@ ] Black Rose. Reason: nvm
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-20-2007 , 22:20   Re: Getting a normal vector
Reply With Quote #3

get_user_aiming()

Or you could fire a traceline and get the end point. Check FM Utilities for that.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
house
Junior Member
Join Date: Mar 2007
Old 10-21-2007 , 10:59   Re: Getting a normal vector
Reply With Quote #4

what ?

I'm trying to get a normal to a part of the map.



That's what normals look like. The normal does not depend on the players' orientation relative to the surface.


EDIT
For clarification, in get_user_origin(...) that 3 is the flag for:
3 - End position from eyes (hit point for weapon)

That would be the surface-point I want the normal from.

Last edited by house; 10-21-2007 at 11:04.
house is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-21-2007 , 12:07   Re: Getting a normal vector
Reply With Quote #5

Code:
 static Float:start[3], Float:dest[3]  pev(id, pev_origin, start)  pev(id, pev_view_ofs, dest)  xs_vec_add(start, dest, start)  pev(id, pev_v_angle, dest)  engfunc(EngFunc_MakeVectors, dest)  global_get(glb_v_forward, dest)  xs_vec_mul_scalar(dest, 9999.0, dest)  xs_vec_add(start, dest, dest)  engfunc(EngFunc_TraceLine, start, dest, IGNORE_MONSTERS, id, 0)  get_tr2(0, TR_vecPlaneNormal, dest)
VEN 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 01:14.


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