Problems with zooming (2D-Text and Line-Class)
I have a Problem using zooming.. I actually try to develop a framework, drawing in 2D with DirectX.. Should work similar to GDI+, so that you just have some Methods like DrawLine(StartPoint, EndPoint), DrawCircle(MidPoint, Radius) and so on.. you just have to give the Points, the Rest does the Framework..
I also use a Texture, in which I project a Camera-Image..
It should be so fast as possible, so I work with Primitives.. DrawingLines with Primitives is a Problem, because the Antialiasing doesn't work the expected way.. It looks horrible.. so I wanted to try the LineClass, because here Lines look fantastic..
But when I draw a Line and then zoom or pan, the Line always stays at the same Position with same size..
Zooming works like this in my Framework:
my Projection:
scaleFactor = 0.9f;
this.projectionWidth *= scaleFactor;
device.Transform.Projection = Matrix.OrthoLH(projectionWidth, ((float)this.ClientRectangle.Height / (float)this.ClientRectangle.Width) * projectionWidth, 1.0f, 10.0f);
this.Invalidate();
my View:
device.Transform.View = Matrix.LookAtLH(cameraPosition, cameraTarget, cameraUp);
when I want to Pan, I just move the CameraPosition and the cameraTarget..
it works really good when I use the Primitives (the Panning and the Zooming).. but not if I use the LineClass.. the same Problem when I use the 2DText-Function:
font.DrawText(null, text, new Rectangle(x, y, this.Width, this.Height), DrawTextFormat.NoClip | DrawTextFormat.ExpandTabs | DrawTextFormat.WordBreak, c);
this also stays the same Position and same Size the whole Time..
any Idea what's wrong? why doesn't the projection takes any Effect on this static elements.. maybe because they are drawn in pixel-coordinats? how can I bring them in my world?

