XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

how to darw 2d image without ID3DX10Sprite

Last post 03-31-2008 12:05 AM by Fatming. 1 replies.
  • 03-28-2008 7:29 AM

    how to darw 2d image without ID3DX10Sprite

    I wanna to draw and without ID3DX10Sprite,below is my idea,

    I have created a buffer,only 1 vertex and assign one ShaderResourceView when I draw it,

    when it's on Vertex shader I setup a Matrix Resource to indicate it's position,

    and I have to setup position info on GeometryShader,

    it should be like this

    2loop for 2face,3loop for each vertex,assign position data to each vertex

    but I have no idea how to get 2d coordinate,

    for example I have one image size is 50,50

    and I want to draw it on screen position 80,80.

    I have using

    D3DXMatrixTransformation2D(,,,,,&Pos);

    to assign WorldMatrixVariable and multiple it with camera worldView Projection

    but I can't see any the image on the screen...

    please give a direction to me ,thanks :)

  • 03-31-2008 12:05 AM In reply to

    Re: how to darw 2d image without ID3DX10Sprite

    forgive my srupid :)

    all I need to do is assign SetOrthographic projection

     

    and  get screen space point

            POINT ptCursor;
            GetCursorPos( &ptCursor );
            ScreenToClient( DXUTGetHWND(), &ptCursor );

     

Page 1 of 1 (2 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG