Results 1 to 2 of 2

Thread: ID3DXSprite.Ddraw() and SetTransform() questions?

  1. #1

    ID3DXSprite.Ddraw() and SetTransform() questions?

    Hi,

    I have TSprite class which has texture and some other variables to control sprite itself.

    In DirectX 8 there was rotation argument in ID3DXSprite.Draw() function but now in DX 9 it's gone.

    So, if I have TD3DMatrix variable in my TSprite class and some private functions which translates and rotates sprite by using D3DXMatrixTranslation, D3DMatrixMultiply and etc. functions. How I can draw sprite with translated, rotated and etc. coordinates?

    I mean that Draw() function takes @TD3DXVector3 structure in position for example, but how I obtain that position in vector because I'm using matrices for translation? Littlebit confusing.

    For example....

    Code:
    type
      TSprite = Class
       private
          Texture:   IDirect3DTexture9;
          Position:   TD3DXVector;
          Origo:      TD3DXVector;
          TransFrm: TD3DMatrix;
          procedure Rotate(Degrees: integer) ;
        public
           procedure Draw;
    
           constructor Create;
           destructor  Destroy;
        end;
    
    
    procedure TSprite.Rotate();
    begin
       // calculates rotation here and stores it to TransFrm matrix.
    end.
    
    procedure TSprite.Draw;
    begin
      D3DXSprite.SetTransform(TransFrm);
    
      // How this sould be called so that matrice effects?
      D3DXSprite.Draw(Texture, @rect, @Origo, @Position, $FFFFFFFF);
    end;
    - In a world without the wall and fences, who will need the Gates and Windows.

  2. #2

    ID3DXSprite.Ddraw() and SetTransform() questions?

    Nothing anymore. I managed to find out how to use matrices with the sprites by my self.
    - In a world without the wall and fences, who will need the Gates and Windows.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •