游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2199|回复: 4

Directx 9.0 ???????00!

[复制链接]

1

主题

3

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2011-9-5 08:59:00 | 显示全部楼层 |阅读模式
????????????????0?0?4??????????0?0?0????????????????????????????????  ?????????????
       Vertex* vertices;
        Triangle->Lock(0, 0, (void**)&vertices, 0);

        vertices[0] = Vertex(-1.0f, 0.0f, 2.0f);
        vertices[1] = Vertex( 0.0f, 1.0f, 2.0f);
        vertices[2] = Vertex( 1.0f, 0.0f, 2.0f);

        Triangle->Unlock();

        //
        // Set the projection matrix.
        //

        D3DXMATRIX proj;
        D3DXMatrixPerspectiveFovLH(
                        &proj,                        // result
                        D3DX_PI,               // 90 - degrees
                        (float)Width / (float)Height, // aspect ratio
                        1.0f,                         // near plane
                        1000.0f);                     // far plane
        Device->SetTransform(D3DTS_PROJECTION, &proj);


                D3DXVECTOR3 position(0.0f, 0.0f, 4.0f);
                D3DXVECTOR3 target(0.0f, 0.0f, 0.0f);
                D3DXVECTOR3 up(0.0f, 1.0f, 0.0f);
                D3DXMATRIX V;
                D3DXMatrixLookAtLH(&V, &position, &target, &up);

                Device->SetTransform(D3DTS_VIEW, &V);
                //}
                Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
                Device->BeginScene();

                Device->SetStreamSource(0, Triangle, 0, sizeof(Vertex));
                Device->SetFVF(Vertex::FVF);

                // Draw one triangle.
                Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);

                Device->EndScene();
                Device-&gtresent(0, 0, 0, 0); [em6]

10

主题

55

帖子

55

积分

注册会员

Rank: 2

积分
55
发表于 2011-9-6 09:55:00 | 显示全部楼层

Re:Directx 9.0 ???????00!

1.???????+Z?-Z?????????????
2.????????????180°????????90°
3.????????????????????????DIFFUSE??????????Stream???material???????????????????????????????????????????

6

主题

74

帖子

230

积分

中级会员

Rank: 3Rank: 3

积分
230
发表于 2011-9-6 18:20:00 | 显示全部楼层

Re:Directx 9.0 ???????00!

1.????,??????????????????????????
2.??D3DRS_CULLMODE?none,
3.fov ??pi/2

??????

1

主题

3

帖子

0

积分

新手上路

Rank: 1

积分
0
 楼主| 发表于 2011-9-8 20:32:00 | 显示全部楼层

Re:Directx 9.0 ???????00!

??,????,???

1

主题

3

帖子

0

积分

新手上路

Rank: 1

积分
0
 楼主| 发表于 2011-9-8 21:56:00 | 显示全部楼层

Re: Re:Directx 9.0 ???????00!

sanxcoo: Reirectx 9.0 ???????00!

1.???????+Z?-Z?????????????
2.????????????180°????????...

???,????
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-11-22 13:24

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表