Sign in to follow this  
Conny14156

Question about DirectX11 and braynzarsoft tutorial 18 FPS Camera

Recommended Posts

Hi,

Am trying to render a simple plane that work like the ground.

And this is the tutorial am following. in this tutorial he is 

 


//Plane Vertex Vertex(-1.0f, -1.0f, -1.0f, 100.0f, 100.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, -1.0f, 0.0f, 100.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f), Vertex(-1.0f, -1.0f, 1.0f, 100.0f, 0.0f, 0.0f, 1.0f, 0.0f),



 DWORD indices[] = 
{
 0, 1, 2,
 0, 2, 3, 
}; 

void UpdateScene(double time)

{

groundWorld = XMMatrixIdentity(); //Define cube1's world space matrix

Scale = XMMatrixScaling( 500.0f, 10.0f, 500.0f );

Translation = XMMatrixTranslation( 0.0f, 10.0f, 0.0f );

groundWorld = Scale * Translation;

}

XMMATRIX groundWorld; 
XMMATRIX Translation;
XMMATRIX Scale ;

 

 


 

 

 

The problem with this plane, is that when I try to render it I see nothing.

The problem I could come up with was that the plane was facing down and not up.

So I tried to rotate the plane and I succeded to see it, but I was wondering why in hes example he got the plane facing upward but while mine is facing downward.

P.S

I also got direction light and on mine after I rotate the plane the light bounce as normal. but how come my plane start facing downward and not upward?

I posted what I think is the most essensial. but please do tell me if I miss something

 

 

http://www.braynzarsoft.net/index.php?p=D3D11FPC

Share this post


Link to post
Share on other sites

You can make yours face upwards by simply reversing the rendering of the vertices, instead of:

 

//Plane Vertex Vertex(-1.0f, -1.0f, -1.0f, 100.0f, 100.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, -1.0f, 0.0f, 100.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f), Vertex(-1.0f, -1.0f, 1.0f, 100.0f, 0.0f, 0.0f, 1.0f, 0.0f),

 

do this:

 

//Plane Vertex Vertex(-1.0f, -1.0f, 1.0f, 100.0f, 0.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f), Vertex( 1.0f, -1.0f, -1.0f, 0.0f, 100.0f, 0.0f, 1.0f, 0.0f), Vertex(-1.0f, -1.0f, -1.0f, 100.0f, 100.0f, 0.0f, 1.0f, 0.0f),

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this