P
Peter Webb
I am writing some visualisation code for 4 dimensional geometric shapes.
This is to run in the C# .NET XNA environment, so I am cross posting a maths
and C# group.
My software runs just fine for 3D objects - for example I can draw cubes,
tetrahedrons, icosahedrons etc and rotate them on screen. All of the "heavy
lifting" is done by the XNA libraries, which have transformation libraries
to map 3D constructs onto 2D with perspective. Using the standard XNA
libraries, I can draw the 3D objects as seen from any point of view in 3D
space, rotate them, etc.
My plan is to construct my 4D objects using a series of 4 Vectors specifying
each vertex. I then project these vertices onto 3D space from a particular
viewpoint and feed these 3D objects into my existing 3D code.
In 3D, to convert to 2D, I do this by defining the viewpoint as a Vector3
(say x,y,z), the point I am looking towards (which can be (0,0,0)), and an
"up" unit vector (perpendicular to (x,y,z)) which defines which way is "up"
in the presented view. XNA then does the Matrix transformation 3D -> 2D for
me.
I need to create a similar transformation matrix for 4D to 3D.
I have a viewpoint in space - say (x1, y1, z1, w1). I need to know the
co-ordinates of another point - (x2, y2, z2, w2) as a Vector3 (a,b,c) if I
am looking from my viewpoint towards (say) the origin. By analogy with the
3D to 2D case, I will need to define one or possibly two unit vectors
perpendicular to (x1,y1,z1,w1) - though not necessarily perpendicular to
each other (?) - that define the "up" direction and maybe the "left"
direction.
So I need a transformation matrix T, based on (x1,y1,z1,w1) and one or
possibly two unit vectors perpendicular to (x1,y1,z1,w1) which will map any
point (x2,y2,z2,t2) onto a 3D point (a,b,c), corresponding to where it
appears in 3D space from that 4D viewpoint.
I am pretty sure that I just need a constant 4x3 matrix T, and I multiply
each of my 4D vectors (representing vertices) by this matrix T to get the 3D
projection.
Does anybody know what T will look like? I haven't been able to find an
example on Google, and my math skills/visualisation ability is not
sufficient to construct T explicitly myself.
Alternatively, any other way to skin this cat?
TIA
Peter Webb
This is to run in the C# .NET XNA environment, so I am cross posting a maths
and C# group.
My software runs just fine for 3D objects - for example I can draw cubes,
tetrahedrons, icosahedrons etc and rotate them on screen. All of the "heavy
lifting" is done by the XNA libraries, which have transformation libraries
to map 3D constructs onto 2D with perspective. Using the standard XNA
libraries, I can draw the 3D objects as seen from any point of view in 3D
space, rotate them, etc.
My plan is to construct my 4D objects using a series of 4 Vectors specifying
each vertex. I then project these vertices onto 3D space from a particular
viewpoint and feed these 3D objects into my existing 3D code.
In 3D, to convert to 2D, I do this by defining the viewpoint as a Vector3
(say x,y,z), the point I am looking towards (which can be (0,0,0)), and an
"up" unit vector (perpendicular to (x,y,z)) which defines which way is "up"
in the presented view. XNA then does the Matrix transformation 3D -> 2D for
me.
I need to create a similar transformation matrix for 4D to 3D.
I have a viewpoint in space - say (x1, y1, z1, w1). I need to know the
co-ordinates of another point - (x2, y2, z2, w2) as a Vector3 (a,b,c) if I
am looking from my viewpoint towards (say) the origin. By analogy with the
3D to 2D case, I will need to define one or possibly two unit vectors
perpendicular to (x1,y1,z1,w1) - though not necessarily perpendicular to
each other (?) - that define the "up" direction and maybe the "left"
direction.
So I need a transformation matrix T, based on (x1,y1,z1,w1) and one or
possibly two unit vectors perpendicular to (x1,y1,z1,w1) which will map any
point (x2,y2,z2,t2) onto a 3D point (a,b,c), corresponding to where it
appears in 3D space from that 4D viewpoint.
I am pretty sure that I just need a constant 4x3 matrix T, and I multiply
each of my 4D vectors (representing vertices) by this matrix T to get the 3D
projection.
Does anybody know what T will look like? I haven't been able to find an
example on Google, and my math skills/visualisation ability is not
sufficient to construct T explicitly myself.
Alternatively, any other way to skin this cat?
TIA
Peter Webb