Draw Circle
Draw Circle
Draw Circle
Draw Circle
Draw Circle
Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle
Draw Circle Draw Circle
Draw Circle
Go Back  Xtreme Visual Basic Talk > > > > Draw Circle


Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2006, 09:46 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default Draw Circle


I need to draw (not load from an image) a circle to the screen. Just a 2D circle, so it should be in screen coordinates. Is there an easy DX method to draw a circle, or am I going to have to do it myself by connecting a bunch of lines together?
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
  #2  
Old 08-20-2006, 07:44 AM
Iceplug's Avatar
IceplugDraw Circle Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

You can always have a bitmap of some circular object with some transparent color for the parts that are not in the circle and apply it to a rectangular surface with the transparency so it appears as a circle.

It would take a lot of triangles to make a decent circle. (Depending on the size too.)
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 08-20-2006, 02:21 PM
talyrond talyrond is offline
Regular
 
Join Date: Sep 2004
Posts: 66
Default

Yes if you want to draw circles then you must use as series of line segements, every thing in Direct3D is made from points, lines and triangle
Reply With Quote
  #4  
Old 08-21-2006, 11:34 AM
ShadowWolf ShadowWolf is offline
Centurion
 
Join Date: Jan 2006
Location: Finland
Posts: 114
Default Guess

What about Direct3DX? That one has some drawing functions... I recall it had: line, rectangle, circle etc.
Reply With Quote
  #5  
Old 08-21-2006, 07:32 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default

I'm sorry, I should have been more specific. I need to make an outline of a circle, not a filled in circle. So I'm not using triangles right now, I'm connecting a bunch of lines to make a decagon, which looks like a circle when it's small enough.
Usually, when a graphics device has a circle or elliptical function (like .NET's graphics object and it's DrawEllipse() method), it uses actual circle drawing algorithms instead of "many sided polygons", so you get a smooter effect. That's what I'm trying to find in DX.
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
  #6  
Old 08-22-2006, 09:13 AM
RcSepp RcSepp is offline
Regular
 
Join Date: Oct 2004
Posts: 55
Default Use GDI like in a picturebox

Quote:
Originally Posted by Moohasha
like .NET's graphics object and it's DrawEllipse() method
I'm currently not in range of a pc with a .net environment on it, but why don't you just make a bitmap, set a graphics object on it and draw this bitmap as a sprite

something like:


Code:
dim bmp as new bitmap(width,height)
dim G as new graphics = graphics.fromimage(bmp)
G.drawellipse(...)
G.dispose()
dim sprite as ...
For the rest I would need DirectX. I can't remember the exact code.
Reply With Quote
  #7  
Old 08-22-2006, 05:36 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default

That's interesting an interesting idea. I'll look into it. Thanks
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Draw Circle
Draw Circle
Draw Circle Draw Circle
Draw Circle
Draw Circle
Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle Draw Circle
Draw Circle
Draw Circle
 
Draw Circle
Draw Circle
 
-->