Skip to main content
deleted 2 characters in body; edited title
Source Link
user1430
user1430

Rotating object round circumerferencearound circumference of circle

I'm trying to get thea lens texture to rotate around the circumference of the circle and although I picked the centre of the circle as the rotating point of the lens it doesn't work.

 private float angle;

//Initialize Method  
circlePosition.X = vp.X + vp.Width / 2;
circlePosition.Y = vp.Y + vp.Height / 2;

lensPosition.X = circlePosition.X;
lensPosition.Y = circlePosition.Y + 155;

//Load Content Method  
circleOrigin.X = Circle.Width / 2;
circleOrigin.Y = Circle.Height / 2;

lensOrigin.X = Lens.Width / 2;
lensOrigin.Y = Lens.Height / 2;

 //Update Method 
 angle += 0.005f;



//Draw Method
spriteBatch.Draw(Circle, circlePosition, null, Color.White, 0.0f,
    circleOrigin, 1.0f, SpriteEffects.None, 0f);

spriteBatch.Draw(Lens, lensPosition, null, Color.White, angle,
  circleOrigin, 1.0f, SpriteEffects.None, 0f);

Rotating object round circumerference of circle

I'm trying to get the lens texture to rotate around the circumference of the circle and although I picked the centre of the circle as the rotating point of the lens it doesn't work.

 private float angle;

//Initialize Method  
circlePosition.X = vp.X + vp.Width / 2;
circlePosition.Y = vp.Y + vp.Height / 2;

lensPosition.X = circlePosition.X;
lensPosition.Y = circlePosition.Y + 155;

//Load Content Method  
circleOrigin.X = Circle.Width / 2;
circleOrigin.Y = Circle.Height / 2;

lensOrigin.X = Lens.Width / 2;
lensOrigin.Y = Lens.Height / 2;

 //Update Method 
 angle += 0.005f;



//Draw Method
spriteBatch.Draw(Circle, circlePosition, null, Color.White, 0.0f,
    circleOrigin, 1.0f, SpriteEffects.None, 0f);

spriteBatch.Draw(Lens, lensPosition, null, Color.White, angle,
  circleOrigin, 1.0f, SpriteEffects.None, 0f);

Rotating object around circumference of circle

I'm trying to get a lens texture to rotate around the circumference of the circle and although I picked the centre of the circle as the rotating point of the lens it doesn't work.

 private float angle;

//Initialize Method  
circlePosition.X = vp.X + vp.Width / 2;
circlePosition.Y = vp.Y + vp.Height / 2;

lensPosition.X = circlePosition.X;
lensPosition.Y = circlePosition.Y + 155;

//Load Content Method  
circleOrigin.X = Circle.Width / 2;
circleOrigin.Y = Circle.Height / 2;

lensOrigin.X = Lens.Width / 2;
lensOrigin.Y = Lens.Height / 2;

 //Update Method 
 angle += 0.005f;



//Draw Method
spriteBatch.Draw(Circle, circlePosition, null, Color.White, 0.0f,
    circleOrigin, 1.0f, SpriteEffects.None, 0f);

spriteBatch.Draw(Lens, lensPosition, null, Color.White, angle,
  circleOrigin, 1.0f, SpriteEffects.None, 0f);
Tweeted twitter.com/#!/StackGameDev/status/53426397930196992
Source Link
dbomb101
  • 950
  • 1
  • 11
  • 26

Rotating object round circumerference of circle

I'm trying to get the lens texture to rotate around the circumference of the circle and although I picked the centre of the circle as the rotating point of the lens it doesn't work.

 private float angle;

//Initialize Method  
circlePosition.X = vp.X + vp.Width / 2;
circlePosition.Y = vp.Y + vp.Height / 2;

lensPosition.X = circlePosition.X;
lensPosition.Y = circlePosition.Y + 155;

//Load Content Method  
circleOrigin.X = Circle.Width / 2;
circleOrigin.Y = Circle.Height / 2;

lensOrigin.X = Lens.Width / 2;
lensOrigin.Y = Lens.Height / 2;

 //Update Method 
 angle += 0.005f;



//Draw Method
spriteBatch.Draw(Circle, circlePosition, null, Color.White, 0.0f,
    circleOrigin, 1.0f, SpriteEffects.None, 0f);

spriteBatch.Draw(Lens, lensPosition, null, Color.White, angle,
  circleOrigin, 1.0f, SpriteEffects.None, 0f);