I have a question. Does somebody knows a good tutorial to draw 3D with Direct3D and VB.NET.
I'm trying to draw a cube on the screen with Direct3D, and afterwards I want to draw cylinders and other 3D polygons.
Can somebody help me?
I got one for a cube. It uses Managed Direct3D and isn't the prettiest in the world since the triangles that make up each vertexed side are hard coded, but the end result is nice. You can spin the thing in 3D space with the mouse. It's my only example of "drawing" a 3D object in DirectX, rather than just loading in a mesh.
I tried to do a sphere generator as well but it suffered from vertex inversion that I couldn't quite figure out (half the triangles were drawn the wrong way and thus, appeared as holes in the sphere)
If this is what you're looking for, I can pack it up and post it.
In this example, I'm just drawing the triangles of the cube object manually rather than load in a mesh, but since it's only a cube, it's easily done. Now, drawing on the faces would be done by applying textures to them. You would make a set of textures each representing the face of a dice and tell the engine to apply them to the appropriate face. I have an example of this somewhere using a meshed object. Let me see if I can adapt it to this generated object.
A Rubik's cube would be easiest done by generating multiple cube objects. Make 26 individual cubes, and stack them into a 3x3x3 arrangement (you can skip the center-most cube). This way, you can create rotation methods for rotating the various slices.
Last edited by Jenner; Mar 12th, 2011 at 06:28 PM.
Easy enough and nothing new since WPF natively uses Direct3D and has plenty of support for simple 3D operations. This example is more about setting up your own Direct3D environment using WinForms as a base and drawing to it. You realize this thread is over a year and a half old too?