GDI3D - 3D auch ohne DirectX

    • Beta

    Es gibt 92 Antworten in diesem Thema. Der letzte Beitrag () ist von Quadsoft.

      Hallo,

      @Scream: ich würde sagen, wenn du einen SketchUp Model importer willst, dann mach ihm doch am besten mal Pseudo(oder VB) Code, mit dem man die Vertices und Farben auslesen kann :P

      Mfg jvbsl
      Ich wollte auch mal ne total überflüssige Signatur:
      ---Leer---
      Hallo,

      mit World solltest du die Objekte rotieren lassen können und skalieren sowie verschieben und mit View die Kamera, habs jetzt zwar nicht getestet, aber er hatte ja bereits im ersten Thread von diesen Matrizen gesprochen...

      Mfg jvbsl
      Ich wollte auch mal ne total überflüssige Signatur:
      ---Leer---

      Gelöschter Benutzer schrieb:

      also er zeigt kein Fehler an bis:

      Zitat
      Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: Der Typ "GDI3D.Graphics3D" in der Assembly "GDI3D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" konnte nicht geladen werden..


      der kommt bei Debuggen

      weiß jemand wa man da machen kann
      Hab ich auch :C
      in dem Fenster wo die Fehlermeldung steht, steht auch Details anzeigen, drück dadrauf, dann öffnet sich wahrscheinlich ein Eigenschaftenfenster, dort gibt es den Eintrag "InnerException" diesen wählst du aus und kopierst den Inhalt hier rein...
      Ich wollte auch mal ne total überflüssige Signatur:
      ---Leer---
      Ouh man .... Entschuldige :)

      InnerException
      StackTrace
      Spoiler anzeigen
      bei GDI3D.Form1.Form1_Resize(Object sender, EventArgs e)
      bei System.Windows.Forms.Control.OnResize(EventArgs e)
      bei System.Windows.Forms.Form.OnResize(EventArgs e)
      bei System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
      bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
      bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
      bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Form.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Control.set_Size(Size value)
      bei System.Windows.Forms.Control.SetClientSizeCore(Int32 x, Int32 y)
      bei System.Windows.Forms.Form.SetClientSizeCore(Int32 x, Int32 y)
      bei System.Windows.Forms.Control.set_ClientSize(Size value)
      bei System.Windows.Forms.Form.set_ClientSize(Size value)
      bei GDI3D.Form1.InitializeComponent() in C:\Users\dod\Documents\Visual Studio 2008\Projects\GDI3D\GDI3D\Form1.Designer.vb:Zeile 31.
      bei GDI3D.Form1..ctor()

      Ausnahmedeteil
      Spoiler anzeigen
      System.InvalidOperationException wurde nicht behandelt.
      Message="Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: Der Typ \"GDI3D.Graphics3D\" in der Assembly \"GDI3D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" konnte nicht geladen werden.."
      Source="GDI3D"
      StackTrace:
      bei GDI3D.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 190.
      bei GDI3D.My.MyProject.MyForms.get_Form1()
      bei GDI3D.My.MyApplication.OnCreateMainForm() in C:\Users\dod\Documents\Visual Studio 2008\Projects\GDI3D\GDI3D\My Project\Application.Designer.vb:Zeile 35.
      bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
      bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
      bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
      bei GDI3D.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
      bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
      bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
      bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
      bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
      bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
      bei System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.TypeLoadException
      Message="Der Typ \"GDI3D.Graphics3D\" in der Assembly \"GDI3D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" konnte nicht geladen werden."
      Source="GDI3D"
      TypeName="GDI3D.Graphics3D"
      StackTrace:
      bei GDI3D.Form1.Form1_Resize(Object sender, EventArgs e)
      bei System.Windows.Forms.Control.OnResize(EventArgs e)
      bei System.Windows.Forms.Form.OnResize(EventArgs e)
      bei System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
      bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
      bei System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
      bei System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Form.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
      bei System.Windows.Forms.Control.set_Size(Size value)
      bei System.Windows.Forms.Control.SetClientSizeCore(Int32 x, Int32 y)
      bei System.Windows.Forms.Form.SetClientSizeCore(Int32 x, Int32 y)
      bei System.Windows.Forms.Control.set_ClientSize(Size value)
      bei System.Windows.Forms.Form.set_ClientSize(Size value)
      bei GDI3D.Form1.InitializeComponent() in C:\Users\dod\Documents\Visual Studio 2008\Projects\GDI3D\GDI3D\Form1.Designer.vb:Zeile 31.
      bei GDI3D.Form1..ctor()
      InnerException:


      Der Rest stand eigendlich schon in der Fehlermeldung drinnen.

      Ich habs falsch ... ich weiss es :C
      @editor:

      Das Problem, ist dass bei Dir das Resize-Event aufgerufen wird bevor überhaupt eine Graphics3D-Instanz erstellt wurde. (=> kein Objektverweis).
      Wahrscheinlich hast du die Start-Größe deiner Form geändert. (das dazu führt, dass Resize aufgerufen wird)

      Ich ändere das nochmal:

      VB.NET-Quellcode

      1. Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
      2. ' Da sich nun das Sichtfenster verändert hat, muss auch die Zeichenfläche und
      3. ' das Seitenverhältnis der Projektion verändert werden
      4. If Sample_Graphics IsNot Nothing Then
      5. Sample_Graphics.Bounds = Me.ClientSize
      6. Sample_Graphics.Transform_Projection = Matrix.Projection(Math.PI / 4, Me.ClientSize.Width / Me.ClientSize.Height, 0.1, 1000)
      7. End If
      8. End Sub



      @jvbsl:
      Ja, leider wahrscheinlich nicht mehr. Ich lade später nochmal mein Versuch daran hoch. Dann kannst du ja mal versuchen, die Performance irgendwie höher auf den Berg zu rollen.^^
      Cool! 3D mit GDI! hm... ich kann das teil entweder X oder Y oder Z rotiern lassen, jedoch nicht gleichzeitig... geht das schon?

      EDIT:
      Und wie ich sehe, ist in deinem Spiel auch das mit der Z achse eingebaut, geht das auch mit deinen uploads aus diesem Thread?
      Ist zwar schon älter, aber so geht das z.B

      VB.NET-Quellcode

      1. Sample_Graphics.Transform_World = Matrix.Multiply(Matrix.Rotate_X_Axis(Now.Millisecond * (Math.PI * 2) / 1000), Matrix.Rotate_Y_Axis(Now.Millisecond * (Math.PI * 2) / 1000))