Not a member yet? Register for your free account!


You last visited: Today at 05:55

  • Please register to post and access all features, it's quick, easy and FREE!

 

move object around circle on c#

This is a discussion on move object around circle on c# within the CO2 Programming forum part of the CO2 Main - Discussions / Questions category; this isn't related to co if u got 2 object , circle and image (or another small circle) how to ...

Reply
 
Thread Tools
Old 03-21-2012, 15:40   #1
#1045-Access denied for
 
Join Date: Jan 2012
Posts: 164
Received Thanks: 22
move object around circle on c#


this isn't related to co
if u got 2 object , circle and image (or another small circle)
how to let the small circle goes around the big one (from it's center it's center throw the circumstance of the big one) , well what about the small one spin around itself ?

i was trying to do this but Graphics >> creategraphics dont actually gives u the graphic u created as object , it just draw it -.-

any idea or link will be appreciated ..

p.s dont try to get coords throw the big circle being object , try to get it from radius (as every coordinate on the circle is an end point of a radius and it's projection is a 90 degree , which actually it's projection is Y and triangle third side is the X wish it made sense)

__________________

injection illusion logic is offline  
Old 03-21-2012, 19:12   #2
Senior Member
 
Join Date: Jun 2006
Posts: 457
Received Thanks: 66
not sure what you're asking... if you want a small circle to be moving on the circumference of the bigger circle, you can definitely use the right angled triangle method to assign new coordinate for your small circle, and redraw it. Iterate the pre mentioned procedure you will be able to get the small circle moving.
shitboi is offline  
Old 03-22-2012, 02:48   #3
#1045-Access denied for
 
Join Date: Jan 2012
Posts: 164
Received Thanks: 22
true but that's in case the big circle is actually an object which i cant do in c# that's why im asking for help
for example
Quote:
Pen pencolor2 = new Pen(Color.Red);
Graphics draw;
r = d1 / 2;
draw = CreateGraphics();
draw.DrawEllipse(pencolor2, forx(350, r), fory(150, r), d1, d2);
now after i draw a circle , how will i use it and it's just a line o-0
aka it's not an object unlike picture
Quote:
sumopic.Location = new System.Drawing.Point(forx(350,50),fory(150,50));
got my point ?
P.S forx,fory is just methods editing the center as create graphics always using the upper left vertex to draw from not mid point

edit : here is the math
Quote:
int circlePosX = centerX + Math.Cos(degrees) * radius;
int circlePosY = centerY + Math.Sin(degrees) * radius;

where timmer ticks and the angel(degrees) set the speed and this prev method is the path
anyone ?

Last edited by injection illusion logic; 03-22-2012 at 05:15.
injection illusion logic is offline  
Old 03-26-2012, 21:07   #4
Sexy Moderator
 
Join Date: Jul 2005
Posts: 7,493
Received Thanks: 4,323
Yes, I actually bothered to log in to answer this because it both intrigued me (yay graphics) and confused me (yay stupid me).

#1: If you're dealing with graphics... use a graphics framework. XNA is fantastic and super powerful.

#2: If you insist on using base C# then either A: apply proper graphics procedures or B: write in a way that fits with application approach to programming.


If you do wish to work without a framework then you want what amounts to a game loop.

In this case you clear the entire screen and then re-draw the 'current' frame every time you wish to update. This is messy because you're trying to mix your approaches and you loose any benefit or controlability that using a gameloop would give you when used in the proper context (again, look at xna)

If you want to stick with the application type approach then it's also very simple... Instead of using a pen tool to draw an elipse, create an image to represent your circle (can be done programatically from inside the program) and simply move the location of this image around another image.

To clarify, when I say you can create it from inside the program I mean you can manually assign the pixel values for the image to draw a circle as you wish it to look.
pro4never is offline  
Thanks
1 User
injection illusion logic (03-28-2012)
Old 03-27-2012, 18:56   #5
#1045-Access denied for
 
Join Date: Jan 2012
Posts: 164
Received Thanks: 22
fuck my question the most awesome thing that i saw u here once again
and yes if u r drawing in an imagebox it wont be effected with the graphic update which wont remove all what u draw at refresh(ex: minimizing and once any other object move on them)
but yeah framwork with xna is amazing , was trying to build it as native c# but when i used xna it saved alot for me
about image box it's hard to interact with another objects (aka if u got a picture of png with a transparent background it will still not show what's under it which is called layers in photoshop)
thanks once more for the reply and really happy that u logged in to reply
injection illusion logic is offline  
Reply

 

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Circle Tool kakagr DarkOrbit 4 08-27-2011 18:12
Circle Scatter or Circle Right-Clicker ElitePrince CO2 Bots & Macros 14 08-14-2010 00:47
Overhill Circle grafgurke WoW Main - Discussions / Questions 0 01-23-2009 20:06
Fire Circle. roba94 CO2 Main - Discussions / Questions 2 08-31-2008 12:35



All times are GMT +2. The time now is 05:55.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.