Re: Stretch my scene with my new window's size

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: NeoAsimov (neoasimov_at_hotmail.com)
Date: 02/19/04


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.



Relevant Pages

  • Re: ODS-5 question
    ... He's increasing the signal-to-noise ... ratio of the newsgroup! ... Okay. ...
    (comp.os.vms)
  • Re: ADA Releases First Food Guidelines
    ... had a great dinner and a Fanta Wild Cherry ... 21:1 ratio... ... Just why can't they make a decent sugar free Slurpee???? ... (okay, I know the reason, it's that sugar is what keeps it slushy and the chemical reaction isn't the same with AS... ...
    (alt.support.diabetes)
  • Re: infinity
    ... > That's okay. ... although their ratio is essentially 1. ... TO apparently has this delusion ... Prev by Date: ...
    (sci.math)
  • Re: Ubuntu 9.10 display aspect ratio question
    ... Okay. ... It may not be possible to get 1024 x 768, 4:3 ratio, unstretched. ... Anyway, thanks for the replies. ...
    (Ubuntu)