Raised This Month: $ Target: $400
 0% 

[Help] Point To Sky Origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-21-2010 , 00:33   [Help] Point To Sky Origin
Reply With Quote #1

@Everyone:
- How to get a origin: Point to Sky ?
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-21-2010 , 02:50   Re: [Help] Point To Sky Origin
Reply With Quote #2

Are you trying to get the origin someone is looking at? Above someone? Or just the sky in general?
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-21-2010 , 03:54   Re: [Help] Point To Sky Origin
Reply With Quote #3

Like this.
To make a beampoint from origin1 to origin 2
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 11-21-2010 , 04:02   Re: [Help] Point To Sky Origin
Reply With Quote #4

Quote:
Originally Posted by dias View Post
Like this.
To make a beampoint from origin1 to origin 2
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)
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-21-2010 , 06:27   Re: [Help] Point To Sky Origin
Reply With Quote #5

I mean how to get origin From Origin1 to Origin2
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 11-21-2010 , 12:00   Re: [Help] Point To Sky Origin
Reply With Quote #6

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)
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 11-22-2010 , 06:00   Re: [Help] Point To Sky Origin
Reply With Quote #7

oh. Thanks
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
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 11:28.


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