Inside3D!
     

Plane question

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



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Mon Feb 08, 2010 11:46 am    Post subject: Plane question Reply with quote

I post this in the QC section simply because I code QC, and am planning to use this in a QC project, but the answer could be useful for anyone, and written in any programming language.

If I have a plane, and two vectors (could be on the same side of the plane, and the wanted result would be extended to "hit" the plane), and I want to find out the point in-between the vectors, on the plane. I've attempted to make it clearer by providing a picture below, hopefully imageshack doesn't choke:


_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Mon Feb 08, 2010 2:38 pm    Post subject: Reply with quote

any random plane, or a wall ? maybe a wall is easier ...

here is some math for any plane:
http://local.wasp.uwa.edu.au/~pbourke/geometry/planeline/
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Mon Feb 08, 2010 3:54 pm    Post subject: Reply with quote

why not just call a trace and have it print the distance?
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Mon Feb 08, 2010 5:47 pm    Post subject: Reply with quote

Ya a traceline would be the best option, and the point would be stored on the trace.endpos, i think off hand...
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Mon Feb 08, 2010 11:45 pm    Post subject: Reply with quote

It's not a physical plane in the traditional sense, not a part of the map, but one I've created via gamecode. You could say what I'm after is mimicking what traceline does in the engine, except in QC. Anyway, Tei seems to be on to something here, it looks like exactly what I'm after, haven't inspected it yet. Thanks!
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC 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