Forum

Plane question

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Plane question

Postby Urre » Mon Feb 08, 2010 11:46 am

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:

Image
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Teiman » Mon Feb 08, 2010 2:38 pm

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/g ... planeline/
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby ceriux » Mon Feb 08, 2010 3:54 pm

why not just call a trace and have it print the distance?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby r00k » Mon Feb 08, 2010 5:47 pm

Ya a traceline would be the best option, and the point would be stored on the trace.endpos, i think off hand...
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Urre » Mon Feb 08, 2010 11:45 pm

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


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest