Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I understand that DirectX has no primitives for such task. I also understand that the circle should be done with the Line object, through connected segments. But all examples I've found so far are in c++;

 

Come someone one help me?

 

Thanks

  • Leaders
Posted
Is there something in particualar that is stopping you from converting the code to C#? I'm guessing that the C++ code does not use MDX, but if your difficulty is in understanding the different syntax, maybe I could help with the translation.
[sIGPIC]e[/sIGPIC]
Posted

Well, I manged to make it work:

 

for (float fAngle = 0.0f; fAngle <= (2.0f * Math.PI); fAngle += fSteps)
{
     v2[0].X = ptCenter.X + (iRadius * (float)Math.Sin(fAngle));
     v2[0].Y = ptCenter.Y + (iRadius * (float)Math.Cos(fAngle));

     VAR.dxSpriteMain.Draw((Texture)VAR.htGfxResources["1x1"], new Rectangle(0, 0, 1, 1), new Vector3(0, 0, 0), new Vector3(v2[0].X, v2[0].Y, 0), color);
}

 

This is the dot version. But since I did not find any pixel or dot object I'm using a 1x1 texture to build the dots... Too bad some of them get kinda antialized.

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...