View previous topic :: View next topic |
Author |
Message |
Neil
Joined: 17 Oct 2008 Posts: 3
|
Posted: Fri Oct 17, 2008 12:29 pm Post subject: WorldToScreen Quake1 |
|
|
hey, i was wondering if anyone had a WorldToScreen function for quake1, the function itself takes 3d world Coords and converts them to 2d co wards for x y in relation to your monitor, and help or ideas would be great, i have a function in quake that semi works ill post it later on if anyone is interested. |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Fri Oct 17, 2008 7:26 pm Post subject: |
|
|
There's the cs_project/cs_unproject builtins in CSQC (clientside quakec) which do exactly what you describe, but CSQC is limited to the DarkPlaces and FTEQW ports at the moment... _________________ Look out for Twigboy |
|
Back to top |
|
 |
Neil
Joined: 17 Oct 2008 Posts: 3
|
Posted: Sat Oct 18, 2008 4:20 am Post subject: |
|
|
alight thanks, do u think it would help if i pasted my function? |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Sun Oct 19, 2008 4:31 am Post subject: |
|
|
you should be able to obtain a copy of the projection and modelview matricies.
just multiply the source coord by those two matricies and you'll have the 2d coord. it'll typically come out as a value between -1 and 1, so it'll need scaling and biasing.
this is the 'project' function available to csqc. _________________ What's a signature? |
|
Back to top |
|
 |
Neil
Joined: 17 Oct 2008 Posts: 3
|
Posted: Sun Oct 19, 2008 5:56 pm Post subject: |
|
|
ive pretty much got it except for in relation to the players foward origin, if im on the same Z axis or i keep my mouse 'hovered' it works but any change to those 2 result in mixed results, ill clean my function up and post it, maybe it will help |
|
Back to top |
|
 |
|