AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making sense of "get_user_origin" coordinates (https://forums.alliedmods.net/showthread.php?t=171125)

Skarbo 11-02-2011 05:42

Making sense of "get_user_origin" coordinates
 
Hey

Is there any way of making sense of the get_user_origin() "current position" coordinates?

For example here are some coordinates i receive for player over a 10 second period:
Quote:

x = 136 y = -1469 z = 100
x = 127 y = -1665 z = 100
x = 371 y = -1431 z = 100
x = 746 y = -1370 z = 100
x = 504 y = -963 z = 100
I don't understand why i receive negative numbers.

Also, is there any way of calculating the upper left coordinate (0,0) and the lower right coordinate (n-1, n-1) so i can calculate how large the map is?

I would like to plot the coordinates to a overview image of a map.

Thanks

ConnorMcLeod 11-02-2011 07:20

Re: Making sense of "get_user_origin" coordinates
 
A map is a 3d referential, the origin is 0, 0, 0, and depending of the orientation of axis, a place can take negative or positive numbers.
May be a picture would help you. ( forget the left picture ;) )
http://i.msdn.microsoft.com/dynimg/IC208183.png

Skarbo 11-02-2011 07:29

Re: Making sense of "get_user_origin" coordinates
 
Thanks!

That was what i was guessing.

Could you think of a way for me to make sense of the coordinates? So i can plot the coordinates on a overview map.
Maybe a way I can get the minimum and the maximum x, y and z coordinates of a given map.

Sylwester 11-02-2011 11:06

Re: Making sense of "get_user_origin" coordinates
 
It's something like this:
distance in cs / 8 * ZOOM = distance in pixels on overview <mapname>.bmp
center point of an overview <mapname>.bmp corresponds to ORIGIN in cs.
You can find ZOOM and ORIGIN in cstrike/overviews/<mapname>.txt

Skarbo 11-02-2011 12:13

Re: Making sense of "get_user_origin" coordinates
 
I was thinking that file had something to do with it.

But I don't quite get it yet.

For example de_dust (1024px x 768px):
de_dust.txt:
* Zoom: 1.2
* Origin: x=101, y=1071, z=-192
de_dust.bmp:
* Center point: x=512, y=384
Aprox. CT spawn coordinate (in CS):
* x=-264, y=-1518, z=100

Could someone maybe show me how to calculate the coordinate according to the overview picture?

Thanks

Sylwester 11-02-2011 14:55

Re: Making sense of "get_user_origin" coordinates
 
Quote:

distance in cs / 8 * ZOOM = distance in pixels on overview
x axis: (101 - (-264)) / 8 * 1.2 = 54.75
y axis: (1071 - (-1518)) / 8 * 1.2 = 388.35

Center point: Y=512, X=384
512 + 388 = 900
384 + 55 = 439

Skarbo 11-02-2011 15:51

Re: Making sense of "get_user_origin" coordinates
 
Ah, I mixed up the origin X and Y coordinations.

Thank you for your help!


All times are GMT -4. The time now is 14:25.

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