Rebuilding Game Matrices: Fighting the Fov / AspectRatio? menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    nippel's Avatar Active Member
    Reputation
    21
    Join Date
    Jun 2009
    Posts
    71
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rebuilding Game Matrices: Fighting the Fov / AspectRatio?

    Hi,

    since I'm facing the same problem again and I was not able to find a decent explaination / solution, I will just ask here. Everytime I was hooking into the Endscene of a game in order to render my stuff ingame, I was trying to rebuild the gamematrices. Since most of the games use D3D, I simply used the god old:
    Code:
    D3DXVECTOR3 lookAt;
    D3DXVECTOR3 eye; 
    lookAt = GetCameraManager()->GetLookAt();
    eye = GetCameraManager()->GetEye();
    D3DXMatrixLookAtLH(&viewMatrix, &eye, &lookAt, &D3DXVECTOR3(0, 0, -1));
    			
    D3DXMatrixPerspectiveFovLH(&projectionMatrix,fieldOfView,aspectratio,near_plane,far_plane);
    			
    D3DXMatrixIdentity(&worldMatrix);
    
    pdevice->SetTransform(D3DTS_VIEW, &viewMatrix);
    pdevice->SetTransform(D3DTS_PROJECTION, &projectionMatrix);
    pdevice->SetTransform(D3DTS_WORLD, &worldMatrix);
    With this extremlazy n easy way, I only needed to grab the variables:
    CameraPosition
    CameraLookAt

    The problem why I'm writing this post comes from:
    Aspectratio (= device->ViewPort.Width / Viewport.Height)
    FoV (is a static afaik.)

    Everytime one is resizing his screen, the drawn stuff is not allocated at the correct position anymore (which is logical since the perspective is changing). Now the thing is, FieldOfView is a static from what I know and the aspectratio is also (always???) calculated from pretty much self explaining values (width/height). Is it even possible to match the ingame-matrices with the rebuild ones all the time? Is there a formula to calculate the correct FoV or aspectratio? Am I mixing horizontal and vertical FoV somehow?

    Thanks for a hint^^

    Rebuilding Game Matrices: Fighting the Fov / AspectRatio?

Similar Threads

  1. Game Death in the system updated!
    By Jidery in forum Gaming Chat
    Replies: 2
    Last Post: 04-19-2007, 09:47 AM
  2. Slavemasters -- Don't fight the slaves! (Slave Pins, Steamvaults)
    By Liania in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 04-15-2007, 06:58 PM
All times are GMT -5. The time now is 05:49 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search