Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Rectangle GetSystemScreenRect(Data.System system, Rectangle ScreenRectangle, int DrawSize)
- {
- var WorldPosition = (system.Coordinates - WorldOffset).RotateY(WorldRotationY);
- var ScreenPos = Translate(WorldPosition) +new Vector((ScreenRectangle.Width), (ScreenRectangle.Height)); //new Vector(system.Coordinates.Z, system.Coordinates.X) - Position;
- return new Rectangle((int)((ScreenPos.X - ScreenRectangle.Width / 2)), (int)((ScreenPos.Y - ScreenRectangle.Height / 2)), DrawSize, DrawSize);
- }
- private Vector Translate(Data.Vector3 Point)
- {
- Vector returnVec = new Vector();
- if (Point.Z - CameraPosition.Z >= 0)
- {
- returnVec.X = (int)((double)-(Point.X - CameraPosition.X) / (-0.1f) * CameraZoom);
- returnVec.Y = (int)((double)(Point.Y - CameraPosition.Y) / (-0.1f) * CameraZoom);
- }
- else
- {
- returnVec.X = (float)((Point.X - CameraPosition.X) / (Point.Z - CameraPosition.Z) * CameraZoom);
- returnVec.Y = (float)(-(Point.Y - CameraPosition.Y) / (Point.Z - CameraPosition.Z) * CameraZoom);
- }
- return returnVec;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement