markraz
Full Member
- Joined
- Feb 19, 2014
- Messages
- 338
I have a bunch of questions:
I'm trying to write a 3d game in C++. I have no problems with 2d matrices but 3d is giving me some trouble since I am mildly retarded. If I have a bunch of vectors that will represent vertices of the polygon data and I want to ultimately view them in 3D. I want to be to view this data in various projections mode i.e. orthographic and perspective for starters. I apparently have to multiply the vectors by various projection matrices to obtain these ortho and persp views. To view in 3D I think I have to project to 2D since pc screen is 2d.
My first question is:
1. To obtain various ortho views (front side top) do I ultimately have to transform the vectors to represent a particular view? So I'm not really moving an imaginary "camera" or "eye" perse am I really ultimately just rotating the vectors(vertices) to project in different views? giving an illusion that I move a camera or 'eye'?? is that correct?
2. What would these projection matrices look like? would front be 1 1 0 ? and side be 1 0 1 and top be 0 1 1?
Front
1 0 0 0
0 1 0 0
0 0 0 0
0 0 0 1
side
1 0 0 0
0 0 0 0
0 0 1 0
0 0 0 1
top
0 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
then multiply either of these times a 3d vector?
x
y
z
1
is that how they do it? thank you so much math friends
I'm trying to write a 3d game in C++. I have no problems with 2d matrices but 3d is giving me some trouble since I am mildly retarded. If I have a bunch of vectors that will represent vertices of the polygon data and I want to ultimately view them in 3D. I want to be to view this data in various projections mode i.e. orthographic and perspective for starters. I apparently have to multiply the vectors by various projection matrices to obtain these ortho and persp views. To view in 3D I think I have to project to 2D since pc screen is 2d.
My first question is:
1. To obtain various ortho views (front side top) do I ultimately have to transform the vectors to represent a particular view? So I'm not really moving an imaginary "camera" or "eye" perse am I really ultimately just rotating the vectors(vertices) to project in different views? giving an illusion that I move a camera or 'eye'?? is that correct?
2. What would these projection matrices look like? would front be 1 1 0 ? and side be 1 0 1 and top be 0 1 1?
Front
1 0 0 0
0 1 0 0
0 0 0 0
0 0 0 1
side
1 0 0 0
0 0 0 0
0 0 1 0
0 0 0 1
top
0 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
then multiply either of these times a 3d vector?
x
y
z
1
is that how they do it? thank you so much math friends
Last edited: