直接3D绘图 [英] Direct 3d Drawing

查看:90
本文介绍了直接3D绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次尝试使用direct3d类.我的目标是创建一个3D土地,您基本上可以在该土地上四处走走(他们称之为相机视图).我该如何初始化一个类,以便在其中可以编写类似Gdi绘图表面动作的代码?您不需要带我遍历代码片段,我只想知道如何在我的表单中使Direct3d像表面一样绘制3d土地. ;)

Ive tried out using the direct3d classes for the first time. My goal is to create a 3 dimensional land where you can basically walk around (what they call camera views). How do I initialize a class in where I can just write a code like the Gdi drawing surface actions? You dont need to give me the walk around code snippets, I just want to know how to make Direct3d draw a 3d land like surface in my form. ;)

推荐答案

您使用slimdx:http://slimdx.org/
您必须获取表单/usercontrol的句柄
您将事件配对
然后使用该手柄创建设备
您已经创建了一个游戏循环(构建/渲染/消息/句柄事件)

您已经为显示的每个对象(如3d山)创建了一个自定义界面:
-初始化(初始化私有对象)
-开始(创建对象的3d零件)
-构建(更新对象的3d)
-渲染(渲染3D对象)
-关闭(关闭对象的3d部分)
-处置(首先关闭,然后将每个私有对象设置为null)

您的游戏循环会穿过每个对象..

多数民众赞成在基础.

但是要买书,会导致很多坑.
you use slimdx : http://slimdx.org/
you have to get the handle of the form / usercontrol
you couple the events
you then create the device using that handle
you have made a gameloop (build/render/messages/handle events)

you have create a custom interface for each object (like a 3d mountain) that you show :
- initialize (initializes the private object)
- start (creates 3d part the object)
- build (updates 3d of the object)
- render (renders the 3d object)
- close (close the 3d part of the object)
- dispose (first does close , and then sets every private object to null)

your gameloop walks trough each object..

thats the basics.

but to get a book , cause there are a lot of pits to fall in.


这篇关于直接3D绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆