Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sun, 29 Jun 2008 15:05:25 -0700 (PDT),    group: microsoft.public.win32.programmer.directx.graphics        back       


Hate Your Job?   
Do You Hate Your Job?
If You Are Like Me And REALLY Hate Your Job, You Can Do What I have Done And
Tell All About Your Company At A Great And CHEAP New Site Called
Dont Work For These . Com

http://www.dontworkforthese.com
This Site Has Chat Rooms,
A Joke Section,
A Great Story Section Where You Can Tell All The Funny Or Stupid Things That
Happen Or Have Happened To You During Your Working Day.
Work Forums For You To Ask And Reply To Questions
And Do Not Forget You Can Tell All About Your Terrible Treatment You Endure
While Trying To Make A Living.
Best Of All They DO NOT Want Your Credit Card Details In Order To Join.
You Pay Through PayPal™ And That Means You Know It's Safe.*
They Only Charge £2.50 (or Your Currency Equivalent) For Everything.
You Do NOT Pay For Anything Else For A Whole Year And Have Full Access To
Everything.
Guaranteed.
No Hidden Charges, No Hidden Extras. Membership For A Whole Year. Not A
Monthly Fee In Sight. So Check Out
Dont Work For These . Com
http://www.dontworkforthese.com  Today.
date: Sun, 29 Jun 2008 09:57:01 GMT   author:   unknown

Rotation of an object shrinks it...   
Hi,

I'm basically making a 2D engine, I've started with DirectX few months
ago, so I'm still learning alot of stuff while working with it...I
mean, don't get angry with my questions xD

My situation - I'm using orthogonal projection in my application, it's
set with this code:

D3DXMatrixOrthoLH(&m_matProj, width, height, 0.2f, 20.0f);

, where width and height are those from my window's size. When I
rotate an object 90 degrees, it kinda shrinks it's width with visibly
20-30%, I can't tell exactly how much and what is causing it, I know I
see it. I'm not an expert in math, but I think I correctly ordered the
calculation of the scaling, rotation and translation matrixes, as I
somewhere read it should be S-R-T. So I'm just guessing it's not that
code that causes this problem, I must be missing something. This is my
code that's calculates the world matrix for every object:

	float fOffX, fOffY, fScaleX, fScaleY;
	fScaleX = (float)m_nObjectWidth /m_nScreenWidth;
	fScaleY = (float)m_nObjectHeight / m_nScreenHeight;


	fOffX = ( 0 + (float) m_nObjectPosLeft / m_nScreenWidth  ) - 0.5;
	fOffY = ( 0 - (float) m_nObjectPosTop  / m_nScreenHeight ) + 0.5;


	D3DXMatrixTranslation(&m_PositionMatrix, fOffX, fOffY, 1);
	D3DXMatrixScaling(&m_ScalingMatrix, fScaleX, fScaleY,  0); // scale
the quad with same aspect ratio

	// rotation
	D3DXMatrixRotationYawPitchRoll(&m_RotateMatrix, m_fObjectRotationX,
m_fObjectRotationY, m_fObjectRotationZ);

	m_WorldMatrix = m_ScalingMatrix * m_RotateMatrix  * m_PositionMatrix;


I hope someone knows why do I get shrinking when rotating.

Thanks,
Pencheff
date: Sun, 29 Jun 2008 15:05:25 -0700 (PDT)   author:   Pencheff

Re: Rotation of an object shrinks it...   
[Please do not mail me a copy of your followup]

Pencheff  spake the secret code
 thusly:

>My situation - I'm using orthogonal projection in my application, it's
>set with this code:
>
>D3DXMatrixOrthoLH(&m_matProj, width, height, 0.2f, 20.0f);
>
>, where width and height are those from my window's size. When I
>rotate an object 90 degrees, it kinda shrinks it's width with visibly
>20-30%, [...]

Is your window square?
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
      <http://www.xmission.com/~legalize/book/download/index.html>

        Legalize Adulthood! <http://blogs.xmission.com/legalize/>
date: Wed, 02 Jul 2008 13:13:24 -0700   author:   legalize+ (Richard [Microsoft Direct3D MVP])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us