In my XNA game, I'm using Viewport.Project to get 2d screen coordinates of a sun's 3D coordinates (mainly because it looks nice). I got this working, however, when I look in opposite directions of the sun, I see 2 of them (technically, one). I have no idea what's happening here..
Anyone know what's going on? And how can I prevent this?
To help visualize this, here's a image of what I'm talking about: Hyperlinked image, don't have 10+ rep
This is the code:
Rectangle clientBounds = Window.ClientBounds;
Texture2D sun = Content.Load<Texture2D>(@"Image\Skybox_Sun");
Vector3 coords = new Vector3(1000, 0, 1000);
Vector3 coords1 = graphics.GraphicsDevice.Viewport.Project(coords, camera.Projection, camera.View, Matrix.Identity);
suncoords = coords1;
spriteBatch.Begin();
spriteBatch.Draw(sun, new Vector2(coords1.X, coords1.Y), null, Color.White, 0, new Vector2(cursor.Width / 2, cursor.Height / 2), q, SpriteEffects.None, 0);
spriteBatch.End();