954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

3d cube + c#.net

Hello,

I am creating a windows application to draw 3d cubes. I am preferring to give all the details of the cube in the code itself i.e. dimensions, colour etc.. Suppose there will be two cubes, say with different dimensions and we provide the details with the manner that is mentioned above. This cube will appear whenever I click on the specified button.

I have gone through OPENGL framework to draw this. I could have used that if it would be free to use. However, I searched through web, but unfortunately there are very few information available regarding drawing cube in C#.net.

Any one please provide me a link or some idea about how to draw the cube.


Thanks,
Rajesh

rajeshswain
Newbie Poster
5 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

openGL is freee to use, there is no runtime or development costs that Im aware of. You could also look at XNA which while aimed at gaiming is also a framework for drawing like that.

However, drawing a 3d cube in c# in general would be the same as asking how to draw it on paper, its the same for any language, you need the maths to work out the angles, lengths etc.

LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
 

You can also use DirectX SDK

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

3D is a world of it's own.
I suggest first reading "3D programming for windows" from Charles Petzold.
Learn about the math needed(quaternions ! fun!)
Learn about projections, light, shade, viewports, rotation etc.
Mostly with XAML code but also C# code.
Very good book.

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

Yha ,, 3D programming for windows " is kinda good

Secret-
Newbie Poster
18 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

Draw the cube on a piece of paper. Determine x,y,z for each vertex and write them all down. Then using open GL create your viewing volume and using triangles or another primitive shape map your points in clock-wise direction. This will require some knowledge about OpenGL. You can do all of this with XNA in about 10 lines of code.

iDeveloper
Light Poster
49 posts since Jul 2008
Reputation Points: 31
Solved Threads: 7
 
You can also use DirectX SDK

can you help me i need to draw a cube and sphere with directx

superbokey
Newbie Poster
2 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 
You can also use DirectX SDK


i'm using C# 2008 with directx9

superbokey
Newbie Poster
2 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You