PDA

Click to See Complete Forum and Search --> : Vector Math (hard ...at least to me)


/\/\isanThr0p
Oct 11th, 2002, 07:27 AM
hey everyone
I have a question in vector math.
Alright I got a trapezium from intersecting a plane with a (quadratic)pyramid. Now I believe to remember from game programming that it is possible to translate the four points restricting this trapezium to the x1,x2 plane by multiplying those points (actually their position vectors) with a matrix...
well my questions:
1) Can this be done
2) How do I do it (get the matrix)

Thanks in advance

Evil_Giraffe
Oct 11th, 2002, 07:40 AM
Take your plane.
1) Translate it so that it passes through the origin.
2) Rotate around the x2 axis so that it intersects with the line x2=0,x3=0 (the x1 axis)
3) Rotate around the x1 axis so the plane intersects with the x2 axis.
4) apply those same transformations to your trapezium.

Gotta run, or would explain it more. If you don't understand, someone else will probably clarify before I get a chance to get back here.

Good luck!

/\/\isanThr0p
Oct 11th, 2002, 12:47 PM
thanks, but isn't there a possibility after having found out how to do those transformations to fill a matrix with numbers (according to those transformations) and than just multiplying this matrix with the position vectors to have the same transformation done...

marnitzg
Oct 17th, 2002, 03:36 PM
Do you mean an orthogonal projection?
If so then you just multiply each vector with

_ _
| 1 0 0 |
| 0 1 0 |
| 0 0 0 |
-- --

/\/\isanThr0p
Oct 17th, 2002, 04:25 PM
Alright, I think that's what I need, it's late though, I am going to check it out tomorrow..
thanks...

/\/\isanThr0p
Oct 21st, 2002, 09:49 AM
alright... this is not what I meant.. I was really tired when I read this and than my pc was broke the last days
(defekt motherboard kind of gives you troubles :()
well I will try to clarify..
I want to know how to fill a matrix that I need to multiply the vectors on a plane with so they are all on the x1 x2 plane... so they look to me just like they would look when looking at them from their plane's normal...

marnitzg
Oct 21st, 2002, 03:49 PM
So you want a linear transformation from R3 to R2?

krtxmrtz
Oct 22nd, 2002, 07:50 AM
Try this. I'm not 100% sure it hasn't any flaws / typos / mistakes of any kind, but offhand I think it's correct.
I assume you have already calculated the 4 intersection points. Now, follow the attached image.
http://www.vbforums.com/attachment.php?s=&attachmentid=17942

/\/\isanThr0p
Oct 22nd, 2002, 08:10 AM
alright cool
I took a brief look and I think it is what I want...
need to take a closer look...
I screwed up a math exam because of a little mistake... (coulnd't go any further because I got some odd shaped intersection while I was supposed to get something pretty simple... I found the mistake, but did not have enough time after that... to do the rest...
so it will take me a few days to cool down till I do math for fun again...

thanks for the help, I think it's the right thing... I will drop a line after further examination :)