The online racing simulator
XY positions of tracks
(92 posts, started )
XY positions of tracks
Where is the origin of the XY positions of the LFS tracks? I think it's in the middle, but obviously I can't get into the middle to test it...

Thanks for reading!
It's not really "the middle". If you look at this thread: http://www.lfsforum.net/showthread.php?t=37411 you see that scawen wrote "The LFS coordinate origin (x=0, y=0) is in the centre of the map.". Which means the origin is mostly in the center of the whole track areal.
Im not 100% but whats your aim anyway...
i just know how but its a bit different.

add me on msn: Marco-0510@hotmail.de

I told u what u must make
And whats the easiest way to find the center of the track? I was thinking of resizing the track maps to fit just perfectly in an image, and then finding the center. Or else making a triangle to fit to 3 extremeties of the track, and finding the center of that. Ideas? Thanks for the link too, didn't find anything in search.

I'm making a small app for LFS programmers to show the co-ordinates of the LFS tracks, both by moving the mouse over the track, and by typing co-ordinates.
Quote from dougie-lampkin :
I'm making a small app for LFS programmers to show the co-ordinates of the LFS tracks, both by moving the mouse over the track, and by typing co-ordinates.

Im guessing learning purposes? or else i cant see why people wouldnt just go in game and do it....
Quote from mcgas001 :Im guessing learning purposes? or else i cant see why people wouldnt just go in game and do it....

Mainly for learning yes, with form backgrounds and mouse positions. This would also allow programmers to input a position, and it shows them where it is, or else when the mouse is moved on to the map, it shows the the XY position. It's far easier than driving around the track in-game IMO.
Hope your good at maths then. You will have to scale it down....
Ah, I have an idea for that
In the attached file, would the marked point be the center point? I resized the image background in paint so that it was touching the outside of the track, and then I marked the center point there...
Attached images
BL1.bmp
Wait, no need, I just realised that the center point is easy to find in the pics provided by Scawen

Matter finished...
Sorry for the erm...quadrupal post, but I have trouble with the XY positions. I found how to scale down the images, and that works. However, when I want to get the mouse XY position, it gets the position relative to the screen, but I want it relative to the form. The only way around I've found is to start the form in the top left corner, but it should be moveable. The XY position seen in MS paint is basically what it needs to look like. Any ideas?
#13 - sun
i think this is right for lottery tickets.

int x = getX();

or

X = 0;
Y = 3;
Just get the window's current position, and subtract the window's current top-left corner co-ordinates from your reported co-ordinates (without knowing what you're programming in, etc.). Then set some bounds at (screen coords) - (bottom right corner window coords).

Simple.
Ah ya, thanks James, never thought of the window's position

It's Viusal C#, and IIRC it has info on the window position...

@ Sun: I wasn't looking for anything to do with lottery tickets, I was looking for ways to find the postion of the mouse on-screen...


EDIT: Does anyone know where I can find Window Position in Visual C#? I've had a look and I can't see anything...
I don't think C# has GetWindowRect...I can't find it in the auto-list thingy and it has an error when I put it in...
It's a user32.dll function Import user32.lib and then you're good to go.
In C# you can use the ClientRectangle property of the Form class.
Thanks guys, I'll try those
#21 - sun
Do you put the xy positions of your lottery ticket inside the MSO packet or MCI ?
Quote from sun :Do you put the xy positions of your lottery ticket inside the MSO packet or MCI ?

Sun this thread is not on the same topic as that, please make a post in one of the other threads you created.
On the note of this topic (:tilt, I just thought how inaccurate this is going to be for those without 5000*5000 screens

At the moment on my 1024*768 screen, 1 pixel equals about 5 metres...
You can use relative instead of exact values to allow the screen to scale to any size. It's like in LFS itself, you can resize the LFS window, but all the 3D graphics stay in proportion to each other. 50% of the screen is still 50%, no matter what resolution the user views it through.
#25 - sun
Yes. Rob are you finished making that app for the programmers ? i just relized by hovering your mouse over the track image what Scawen made, it tells you the co-oediantes, so then you can programm it for your lottery tickets or Bank or what ever.

Cheers Scawen

XY positions of tracks
(92 posts, started )
FGED GREDG RDFGDR GSFDG