Jump to content


Photo
- - - - -

How to make work a perspective matrix


  • Please log in to reply
3 replies to this topic

#1 masamune

masamune

    Young Padawan

  • Members
  • Pip
  • 1 posts

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


#2 markjay50

markjay50

    Young Padawan

  • Members
  • Pip
  • 1 posts

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

#3 jane_12

jane_12

    Young Padawan

  • Members
  • Pip
  • 2 posts

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,

#4 _*aprillove20_*

_*aprillove20_*
  • Guests

Posted 19 November 2010 - 03:39 PM

Further explanation on how to make work
a perspective matrix?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users