Inside3D!
     

WorldToScreen Quake1

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Neil



Joined: 17 Oct 2008
Posts: 3

PostPosted: Fri Oct 17, 2008 12:29 pm    Post subject: WorldToScreen Quake1 Reply with quote

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Fri Oct 17, 2008 7:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Neil



Joined: 17 Oct 2008
Posts: 3

PostPosted: Sat Oct 18, 2008 4:20 am    Post subject: Reply with quote

alight thanks, do u think it would help if i pasted my function?
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Sun Oct 19, 2008 4:31 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Neil



Joined: 17 Oct 2008
Posts: 3

PostPosted: Sun Oct 19, 2008 5:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group