Re: Stretch my scene with my new window's size
From: NeoAsimov (neoasimov_at_hotmail.com)
Date: 02/19/04
- Next message: Scott Andrew: "Windowless VMR and Managed DirectX"
- Previous message: Stefan: "Re: Requirements for end-users in managed dx"
- Next in thread: Rich [Microsoft Direct3D MVP]: "Re: Stretch my scene with my new window's size"
- Reply: Rich [Microsoft Direct3D MVP]: "Re: Stretch my scene with my new window's size"
- Messages sorted by: [ date ] [ thread ]
Date: 19 Feb 2004 05:46:10 -0800
Hello,
Okay, if I understand well, I need to do a thing like:
// Get the new dimensions of the display's render target area.
float aspectWidth = (float)mDevice.DisplayMode.Width;
float aspectHeight = (float)mDevice.DisplayMode.Height;
...
mDevice.Transform.Projection = Microsoft.DirectX.Matrix.PerspectiveFovLH(
(float)(System.Math.PI/4), aspectWidth/aspectHeight, 1.0f, 10.0f);
...
I already test this before sending this post and this don't seem to work either.
Thank alot for your help!
Salutations,
> > I have a question: What's the best way to stretch a DX scene with
> >the new size of my window (my render target is a panel).
>
> Change the aspect ratio of your view frustum (via the projection
> matrix) to match the aspect ratio of your new render target area.
- Next message: Scott Andrew: "Windowless VMR and Managed DirectX"
- Previous message: Stefan: "Re: Requirements for end-users in managed dx"
- Next in thread: Rich [Microsoft Direct3D MVP]: "Re: Stretch my scene with my new window's size"
- Reply: Rich [Microsoft Direct3D MVP]: "Re: Stretch my scene with my new window's size"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|