Thread: Setting up 2D game (VIEW)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    i dont think so, hes drawing 2d instead of 3d, so why would he even need a near/far clipping plane?

    oh and btw, heres the code i used to set the position of a sprite:

    Code:
    D3DMATRIX matPosition;
    float fx, fy;
    
    fx = (float)x - (m_nScreenWidth / 2);
    fy = (float)y - ((m_nScreenHeight / 2) - m_nHeight); //m_nHeight is the height of the sprite
    
    D3DXMatrixTranslation(&matPosition, fx, -fy, 0.0f);
    and the negative thing is fine

    edit [just incase you needed a bit more explaining for the code above]

    x, y: coords of where you want to put the sprite
    m_nscreenwidth, m_nscreenheight: self explanatory
    Last edited by X PaYnE X; 06-07-2005 at 07:30 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2d game
    By JordanCason in forum Game Programming
    Replies: 5
    Last Post: 12-08-2007, 10:08 PM
  2. cross platform 2d game questions
    By tuseroni in forum Linux Programming
    Replies: 3
    Last Post: 05-31-2006, 04:13 PM
  3. beach bar (sims type game)
    By DrKillPatient in forum Game Programming
    Replies: 1
    Last Post: 03-06-2006, 01:32 PM
  4. 2D Tile Based Game
    By cboard_member in forum Game Programming
    Replies: 6
    Last Post: 07-29-2005, 01:04 AM
  5. My Memory Game
    By jazy921 in forum C Programming
    Replies: 0
    Last Post: 05-05-2003, 05:13 PM