游戏开发论坛

 找回密码
 立即注册
搜索
查看: 6046|回复: 21

怎么现在VB区越来越冷清了啊?

[复制链接]

43

主题

229

帖子

234

积分

中级会员

Rank: 3Rank: 3

积分
234
QQ
发表于 2006-12-16 05:19:00 | 显示全部楼层 |阅读模式
如题。
好久每来了,发现几天就几贴,那也太夸张了吧?

187

主题

600

帖子

606

积分

高级会员

Rank: 4

积分
606
QQ
发表于 2006-12-16 11:04:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

因为垃圾太多了,我们这些高手都懒得发贴了

187

主题

600

帖子

606

积分

高级会员

Rank: 4

积分
606
QQ
发表于 2006-12-16 11:12:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

    '读取顶点数据
    Dim tMesh           As D3DXMesh
    Dim datas           As New CDataPool
    Set tMesh = g_Mesh.CloneMeshFVF(D3DXMESH_MANAGED, CUSTOM_VERTEX_FVF, g_Dev)
   
    Dim i               As Long
    Dim VertexsBufs()   As TCustomVertex
    ReDim VertexsBufs(tMesh.GetNumVertices - 1)

    Debug.Print "顶点数:"; tMesh.GetNumVertices, "三角形数:", tMesh.GetNumFaces
    datas.AddLong tMesh.GetNumVertices
    datas.AddLong tMesh.GetNumFaces
   
    Dim tVertexsBuf     As Direct3DVertexBuffer8
    Dim tIndexBuf       As Direct3DIndexBuffer8
    Dim lp_buf          As Long
    Dim lp_index_buf    As Long
    Dim lp_SafeArray    As Long
   
    Set tIndexBuf = tMesh.GetIndexBuffer
    Set tVertexsBuf = tMesh.GetVertexBuffer
   
    'Lock返回lp_buf为一个指向顶点数据的指针的指针
    tVertexsBuf.Lock 0, 0, lp_buf, D3DLOCK_READONLY
    '首先得到安全数组的指针
    CopyMemory lp_SafeArray, ByVal VarPtrArray(VertexsBufs), 4
    '修改安全数组的数据指针使其指向锁定的顶点数据
    CopyMemory ByVal (lp_SafeArray + 12), lp_buf, 4
   
    For i = 0 To tMesh.GetNumVertices - 1
        With VertexsBufs(i)
            'Debug.Print .x; ","; .y; ","; .z, , .tu, .tv, .color
            datas.AddFloat .x
            datas.AddFloat .y
            datas.AddFloat .z
            datas.AddFloat .tu
            datas.AddFloat .tv
            datas.AddLong .color
        End With
    Next
    tVertexsBuf.Unlock
   
    '索引顶点数据
    Dim IndexBufs()   As Integer
    ReDim IndexBufs(tMesh.GetNumFaces * 3 - 1)
   
    tIndexBuf.Lock 0, 0, lp_index_buf, D3DLOCK_READONLY
    CopyMemory lp_SafeArray, ByVal VarPtrArray(IndexBufs), 4
    CopyMemory ByVal (lp_SafeArray + 12), lp_index_buf, 4
   
    For i = 0 To tMesh.GetNumFaces - 1
        '一次读取一个三角形
        'Debug.Print IndexBufs(i * 3), IndexBufs(i * 3 + 1), IndexBufs(i * 3 + 2)
        datas.AddLong IndexBufs(i * 3)
        datas.AddLong IndexBufs(i * 3 + 1)
        datas.AddLong IndexBufs(i * 3 + 2)
    Next
    tIndexBuf.Unlock
   
    Dim bytes() As Byte
    datas.GetBytes bytes
    Open "C:\test.dat" For Binary As #1
    Put #1, , bytes
    Close #1

187

主题

600

帖子

606

积分

高级会员

Rank: 4

积分
606
QQ
发表于 2006-12-16 11:17:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

以上代码读取X-Mesh的顶点数据并转换为自定义二进制文件,可是我是不指望还有人能看懂我的代码了
唉~~~
所以懒得跟一帮水手闲聊

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2006-12-16 11:50:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

……

270

主题

6442

帖子

6446

积分

论坛元老

Rank: 8Rank: 8

积分
6446
发表于 2006-12-16 20:58:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

最近在筹划2007年的游戏,没空来聊天,哈哈!

9

主题

688

帖子

688

积分

高级会员

Rank: 4

积分
688
发表于 2006-12-16 22:47:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

准备做什么类型的?

12

主题

525

帖子

525

积分

高级会员

Rank: 4

积分
525
发表于 2006-12-16 22:56:00 | 显示全部楼层

Re: Re:怎么现在VB区越来越冷清了啊?

boywhp: Re:怎么现在VB区越来越冷清了啊?

以上代码读取X-Mesh的顶点数据并转换为自定义二进制文件,可是我是不指望还有人能看懂我的代码了
唉~~~
所以懒得跟一帮水手闲聊

这位老兄说话真是赖蛤麻打呵欠---好大口气。所谓业有专攻,你懂个DX的就拿出来炫,你信不信我写个代码你照样看不懂。

187

主题

600

帖子

606

积分

高级会员

Rank: 4

积分
606
QQ
发表于 2006-12-17 11:23:00 | 显示全部楼层

Re:怎么现在VB区越来越冷清了啊?

我没有学DX,那就是API而已 不值得学,用的时候自己看MS的SDK就可以了
只是顺手举个例子而已,要学的东西是图形学的理论,而不是API

270

主题

6442

帖子

6446

积分

论坛元老

Rank: 8Rank: 8

积分
6446
发表于 2006-12-17 11:56:00 | 显示全部楼层

Re: Re:怎么现在VB区越来越冷清了啊?

xgreenclover: Re:怎么现在VB区越来越冷清了啊?

准备做什么类型的?


保密!明年如果条件成熟可能要转做商业游戏了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-26 05:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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