Jump to content
  • Advertisement
Sign in to follow this  
Fire Lancer

Getting started with D3D10, vertices question

This topic is 3496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My understanding was that a vertex shader is meant to output vertices in screen cordinates. Ie such that (0,0,0) is the top left and (bufferWidth,bufferHeight,0) is the bottom right. So how does this result in a triangle in the centre of the screen???
    SimpleVertex vertices[] =
        D3DXVECTOR3( 0.0f, 0.5f, 0.5f ),
        D3DXVECTOR3( 0.5f, -0.5f, 0.5f ),
        D3DXVECTOR3( -0.5f, -0.5f, 0.5f ),
//vertex shader
float4 VS( float4 Pos : POSITION ) : SV_POSITION
    return Pos;

To that end, what do I need to do to make it work the same as the following transforms with the fixed function pipeline under D3D9? (size is the size of the client area of the window, which is the same as the size of the backbuffer). This makes the z axis be ignored and (0,0) top left and (size.w,size.h) bottom right.
	device->SetTransform(D3DTS_VIEW, &mat);
		(float)(size.h), 0,
		0, 1);
	device->SetTransform(D3DTS_PROJECTION, &mat);

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!