Click here to Skip to main content
15,851,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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. ;)
Posted
Comments
Christian Graus 19-Jul-10 2:05am    
It's very hard to answer this without some idea of what language you're using.
GPUToaster™ 19-Jul-10 2:16am    
"surface in my form"...Is it a Windows Form? If it is then you need to create a Direct3D context and attach it to the Windows Form. Once you are done with it you can use the Terrain Brute Force to create Land using some height maps. To create context i guess you need to create a GDI object which can actually render the Direct3D Drawing. (For 3d land you need to get a 3D height map and Wrap the texture around it)

1 solution

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.
 
Share this answer
 
Comments
CoolC22 28-Jul-12 17:53pm    
Thanks :). The only person on this question to give me useful info instead of just looking at it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900