Forum

WorldToScreen Quake1

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

WorldToScreen Quake1

Postby Neil » Fri Oct 17, 2008 12:29 pm

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.
Neil
 
Posts: 3
Joined: Fri Oct 17, 2008 12:26 pm

Postby Urre » Fri Oct 17, 2008 7:26 pm

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...
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Neil » Sat Oct 18, 2008 4:20 am

alight thanks, do u think it would help if i pasted my function?
Neil
 
Posts: 3
Joined: Fri Oct 17, 2008 12:26 pm

Postby Spike » Sun Oct 19, 2008 4:31 am

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Neil » Sun Oct 19, 2008 5:56 pm

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
Neil
 
Posts: 3
Joined: Fri Oct 17, 2008 12:26 pm


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest