Raised This Month: $ Target: $400
 0% 

Making sense of "get_user_origin" coordinates


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skarbo
Junior Member
Join Date: Mar 2006
Old 11-02-2011 , 05:42   Making sense of "get_user_origin" coordinates
Reply With Quote #1

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

Last edited by Skarbo; 11-02-2011 at 05:47.
Skarbo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-02-2011 , 07:20   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #2

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 ;) )
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-02-2011 at 07:20.
ConnorMcLeod is offline
Skarbo
Junior Member
Join Date: Mar 2006
Old 11-02-2011 , 07:29   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #3

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.
Skarbo is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-02-2011 , 11:06   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #4

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
__________________
Impossible is Nothing

Last edited by Sylwester; 11-02-2011 at 11:07.
Sylwester is offline
Skarbo
Junior Member
Join Date: Mar 2006
Old 11-02-2011 , 12:13   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #5

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

Last edited by Skarbo; 11-02-2011 at 12:15.
Skarbo is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 11-02-2011 , 14:55   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #6

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
__________________
Impossible is Nothing

Last edited by Sylwester; 11-02-2011 at 14:56.
Sylwester is offline
Skarbo
Junior Member
Join Date: Mar 2006
Old 11-02-2011 , 15:51   Re: Making sense of "get_user_origin" coordinates
Reply With Quote #7

Ah, I mixed up the origin X and Y coordinations.

Thank you for your help!
Skarbo 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 14:25.


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