Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

A while ago I created a simple line graph in notepad using GDI+ which was used in a web page. This wasn't to hard, but now I am interested in how I would create a 3D bar chart.

 

After looking around for info on 3D drawing, I have kind of came to the conclusion that I will need to use d3d. Is this correct, or is there a way to do it only with GDI+.

 

Can anybody shed some light, also, if anybody knows of any sources of info, i.e. web sites or books, could you let me know.

 

Cheers,

Gazzo

  • *Experts*
Posted

While you *could* do it in GDI+, you'd be doing all the 3D work yourself. It's not terribly complex, but if you want rotation, changing perspective, etc., it's NOT going to be trivial.

 

If you want to code it yourself you're probably going to want to use Direct3D (as you guessed). If you look at the DirectX8 (not DX9) samples, you'll find a Bar Graph sample done in VB6 that includes a "picker" - as you hover over each bar it gives the numbers in a floating tooltip. You can rotate, zoom, etc. in the VB6 sample.

 

Obviously, you'll have to convert the whole thing to DirectX9 if you want to do it in .NET but it shouldn't be that hard (except for maybe the "picking" part).

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...