theblackdesert

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

100 Neutral

About theblackdesert

  • Rank
    Newbie
  1. Migrating from MDX

    Problem solved: I used Device.GetTransform(TransformState.World) instead of my mWorld in the Unproject Method... silly me..
  2. Migrating from MDX

    I got the quest to migrate an MDX Apllication to SlimDX in order to make it work with .NET 4.0. Im almost finished without understanding DirectX completely ( I will do so after fixing this last problem ) per se. But there is a last problem using Vector3.Project/Unproject Matrix.Multiply or something else im not sure (i wouldnt ask i if knew wheres the problem). The Problem is: Im rendering black Text boxes. createWorldMatrix() generates the WorldMatrix for each TextComponent but when i start to turn the scene the text starts to hop up and down. I think the first part of my code is correct: [code] Matrix mScaling = Matrix.Scaling (scaling, scaling, scaling); Matrix mRotation = TransformUtilities.GetRotationMatrixFromDirectionUpVector(-1.0f * camera.Direction, camera.UpVector); Matrix mTranslation = Matrix.Translation(textPosition); Matrix mWorld = mScaling; mWorld = Matrix.Multiply(mWorld, mRotation); mWorld = Matrix.Multiply(mWorld, mTranslation); MoveTextDirections dir = MoveTextDirections.None; Rectangle tRect = transformTextRectangle (_device, mWorld);[/code] This places the TextComponents on the right place (). Then there is an Algorhitm which moves tRect until it fits with the other TextRectangles using .NET Standard classes so the problem wont be there. Then there is the following code which seems to include the error: [code] //####Just for style-reasons#### Matrix WorldViewProjection = device.GetTransform(TransformState.World) * device.GetTransform(TransformState.View) * device.GetTransform(TransformState.Projection); int Width = device.Viewport.Width; int Height = device.Viewport.Height; int ViewportX = device.Viewport.X; int ViewportY = device.Viewport.Y; float MinZ = device.Viewport.MinZ; float MaxZ = device.Viewport.MaxZ; //############################## Vector3 rCenterScreen = new Vector3(tRect.Left + tRect.Width / 2, tRect.Top + tRect.Height / 2, 0.0f); Vector3 rCenterWorld = Vector3.Unproject(rCenterScreen, ViewportX, ViewportY, Width, Height, MinZ, MaxZ, WorldViewProjection); rCenterWorld = Vector3.TransformCoordinate(rCenterWorld, mWorld); Vector3 rCamScreen = new Vector3(tRect.Left + tRect.Width / 2, tRect.Top + tRect.Height / 2, -1.0f); Vector3 rCamWorld = Vector3.Unproject(rCamScreen, ViewportX, ViewportY, Width, Height, MinZ, MaxZ, WorldViewProjection); rCamWorld = Vector3.TransformCoordinate(rCamWorld, mWorld); Plane pText = DirectXConverter.PlaneFromPointNormal(textPosition, camera.Direction); textPosition = DirectXConverter.PlaneIntersectLine(pText, rCenterWorld, rCamWorld); mTranslation = Matrix.Translation(textPosition); mWorld = mScaling; mWorld = Matrix.Multiply(mWorld, mRotation); mWorld = Matrix.Multiply(mWorld, mTranslation); return mWorld;[/code] The Text is on the right start position if i comment the algorhythm and the 2nd code out. Im gonna add the original source before i started migrating. Please say if you need more information and what information is needed. The Debugoutput gives me nothing useable. Im sorry for my Bad English/ Original Source: http://pastebin.com/ZrviCsSF
  3. Is it just me or is @Grooveshark laggin as hell?
  4. MonoDroid 4.0 ist draussen! Ich werd den kram dann auch mal testen.
  5. Gwibber funktioniert irgendwie nicht richtig..need alternatives
  6. PHP Sicherheit – Teil 1: Hi, da mir in letzter Zeit vermehrt Seiten bzw. Scripts auffallen die erhebliche Sicher... http://t.co/A20RTZBT
  7. Gutschein für 20% auf alles von @shellfire_de, z.B. IRC-Bouncer: http://t.co/NGbTojJT
  8. Solange Linus Torvalds noch lebt fang ich nicht an zu trauern. #RIP Steve Jobs
  9. Mal schauen ob AweSync was taugt.
  10. Gut zu wissen. Ein Bus spaeter is der komplett leer.