
How to make work a perspective matrix
Started by
masamune
, Jun 09 2009 07:20 PM
6 replies to this topic
#1
Posted 09 June 2009 - 07:20 PM
I'm trying to get my head around some 3D graphics, but ran into trouble.
I have a number of points that make up a cube. Very simple.
I use an orthographic projection matrix to display it.
But when I try to apply a perspective projection matrix it looks like anything but a cube. I've tried multiple ways to get it to work but it still doesn't.
You can download the source code here: http://czuban.net/example3.rar
It is written in ActionScript 3.0. But the code is very basic and straight forward so I don't think it's will be a problem even if you are not familiar with ActionScript.
By commenting an uncommenting the following lines (in 3DGraphics.as) you can switch between the orthographic projection and perspective projection matrix. As you can see when just using the orthographic projection matrix it works fine. But with the perspective it doesn't.
// Ortographic and perspective
// mP = mPers.multiplyMatrix(mOrto);
// Just ortographic
mP = mOrto;
my example proposed this in the graphics3d.as
its a rotation only in the y axis and z axis while the rotation on the x axis is on comment
// Create transformation matrix
var mT:Matrix44 = new Matrix44(true);
//mT.applyRotateX(Math.PI/4);
mT.applyRotateY(Math.PI/4);
mT.applyRotateZ(Math.PI/4);
you will see the weird distortion... well if you have any tips i welcome anyone
Posts: 7
Joined: Tue Jun 02, 2009 4:17 am
Private message
I have a number of points that make up a cube. Very simple.
I use an orthographic projection matrix to display it.
But when I try to apply a perspective projection matrix it looks like anything but a cube. I've tried multiple ways to get it to work but it still doesn't.
You can download the source code here: http://czuban.net/example3.rar
It is written in ActionScript 3.0. But the code is very basic and straight forward so I don't think it's will be a problem even if you are not familiar with ActionScript.
By commenting an uncommenting the following lines (in 3DGraphics.as) you can switch between the orthographic projection and perspective projection matrix. As you can see when just using the orthographic projection matrix it works fine. But with the perspective it doesn't.
// Ortographic and perspective
// mP = mPers.multiplyMatrix(mOrto);
// Just ortographic
mP = mOrto;
my example proposed this in the graphics3d.as
its a rotation only in the y axis and z axis while the rotation on the x axis is on comment
// Create transformation matrix
var mT:Matrix44 = new Matrix44(true);
//mT.applyRotateX(Math.PI/4);
mT.applyRotateY(Math.PI/4);
mT.applyRotateZ(Math.PI/4);
you will see the weird distortion... well if you have any tips i welcome anyone
Posts: 7
Joined: Tue Jun 02, 2009 4:17 am
Private message
#2
Posted 02 September 2010 - 07:52 PM
HELLO...GUYZZ....!!!
masamune....i am newbie her, can you please tell
me some information about this site?
please....thanks in advance,
and thanks for accepting me her !!!
have a nice day....!!
.... GOD BLESS....
best regardzzzz........
make money online
masamune....i am newbie her, can you please tell
me some information about this site?
please....thanks in advance,
and thanks for accepting me her !!!
have a nice day....!!
.... GOD BLESS....
best regardzzzz........
make money online
#3
Posted 19 October 2010 - 12:39 AM
hello''
i am new in this site,,..can you please,
explain to me about on how to make work
a perspective matrix''?
thanks a lot'how to deal with depression
cheers,
i am new in this site,,..can you please,
explain to me about on how to make work
a perspective matrix''?
thanks a lot'how to deal with depression
cheers,
#4
_*aprillove20_*
Posted 19 November 2010 - 03:39 PM
Further explanation on how to make work
a perspective matrix?
a perspective matrix?
#5
Posted 25 June 2022 - 03:28 AM
I have a yamaha FC4 sustain pedal that I wish to plug into my trinity, I plug it, and nothing happens,I also tried to push the pedal while pluging it and that didnt helped as well
what should I do?
thanks,
einav.
#6
Posted 30 June 2022 - 04:48 PM
Further explanation on how to make work a perspective matrix?
At all I do not know, as to tell...
#7
Posted 30 June 2022 - 06:36 PM
I have a yamaha FC4 sustain pedal that I wish to plug into my trinity, I plug it, and nothing happens,I also tried to push the pedal while pluging it and that didnt helped as well what should I do? thanks, einav.
At all I do not know, as to tell...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users