if anyone wants to know, i figured out finally how to use it. You have to
covert the mouse coords back into the format like you get from WorldToScreen
My messy functions below seem to work (x/y are the mouse pos)
px = (((float)x)/(0.5f*ScreenWidth))-1;
py = (-1.0)*((((float)y)/(0.5f*ScreenHeight))-1);

----- Original Message -----
From: "Tom Taylor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 22, 2003 11:32 PM
Subject: [hlcoders] ScreenToWorld?


> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> Can anyone shed any light onto how to use this function? My test code is:
>
> //void ( *ScreenToWorld ) ( float *screen, float *world );
> int x,y;
> gEngfuncs.GetMousePosition( &x, &y );
> vec3_t screen,world;
> screen = Vector(x,y,0);
> gEngfuncs.pTriAPI->ScreenToWorld(screen,world);
> char buffer[255];
> sprintf(buffer, "Mouse Down %d %d : %0.3f %0.3f
%0.3f\n",x,y,world[0],world[1],world[2]);
> gEngfuncs.Con_DPrintf(buffer);
> Which gives very very strange outputs (+- figures bigger than 9000!).
>
> Also is there anyway of searching the archive? All i can find is a huge
index which is a bit difficult to use when your looking for specific things.
>
> Thanks,Tom
> --
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to