AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Point To Sky Origin (https://forums.alliedmods.net/showthread.php?t=143520)

dias 11-21-2010 00:33

[Help] Point To Sky Origin
 
@Everyone:
- How to get a origin: Point to Sky ?

Emp` 11-21-2010 02:50

Re: [Help] Point To Sky Origin
 
Are you trying to get the origin someone is looking at? Above someone? Or just the sky in general?

dias 11-21-2010 03:54

Re: [Help] Point To Sky Origin
 
Like this.
To make a beampoint from origin1 to origin 2
http://ca6.upanh.com/16.539.20873315.ghi0/123.png

wrecked_ 11-21-2010 04:02

Re: [Help] Point To Sky Origin
 
Quote:

Originally Posted by dias (Post 1353481)
Like this.
To make a beampoint from origin1 to origin 2
http://ca6.upanh.com/16.539.20873315.ghi0/123.png

Code:
/* These functinos are used to generate client messages.  * You may generate menu, smoke, shockwaves, thunderlights,  * intermission and many many others messages.  * See HL SDK for more examples. */ native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0); native message_end(); native write_byte(x); native write_char(x); native write_short(x); native write_long(x); native write_entity(x); native write_angle(x); native write_coord(x); native write_string(const x[]);
Code:
/* Temp entity message types for message_begin() */ #define TE_BEAMPOINTS               0        // Beam effect between two points // write_byte(TE_BEAMPOINTS) // write_coord(startposition.x) // write_coord(startposition.y) // write_coord(startposition.z) // write_coord(endposition.x) // write_coord(endposition.y) // write_coord(endposition.z) // write_short(sprite index) // write_byte(starting frame) // write_byte(frame rate in 0.1's) // write_byte(life in 0.1's) // write_byte(line width in 0.1's) // write_byte(noise amplitude in 0.01's) // write_byte(red) // write_byte(green) // write_byte(blue) // write_byte(brightness) // write_byte(scroll speed in 0.1's)

dias 11-21-2010 06:27

Re: [Help] Point To Sky Origin
 
I mean how to get origin From Origin1 to Origin2

abdul-rehman 11-21-2010 12:00

Re: [Help] Point To Sky Origin
 
Just expand the vector from origin 1 and then perform a traceline to get the actual origin present in the sky for eg:
Code:
// lets take an example value for origin 1 new Float:origin1[3] = { 1.0, 2.0, 4.0 } // Now we will make a vector which will be pointing towards the sky new Float:vToSky[3] = { 0.0, 0.0, 1.0 } // This is basically a normalized vector which is pointing towards the sky (i.e towards the z-axis) // Now we will extend the vector vToSky[2] *= 99999.0 // Should be enough ?? // Now we will add the vector to origin1 so that we can get an origin presnt in the sky (which will be 99999 units above origin1) new Float:origin2[3] origin2[0] = origin1[0] + vToSky[0] origin2[1] = origin1[1] + vToSky[1] origin2[2] = origin1[2] + vToSky[2] // so origin2 will be { 1.0, 2.0, 100003.0 } // For more safety you can perform a traceline between origin1 and origin2  to get the exact point where the map ends (i.e the point where the sky is present)

dias 11-22-2010 06:00

Re: [Help] Point To Sky Origin
 
oh. Thanks :D


All times are GMT -4. The time now is 11:28.

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