Jump to content
Xtreme .Net Talk

met

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by met

  1. Hello, how can I view and edit a SVG file in vb? thanks
  2. hello, how can I save an ASE file as an XML file? See attach file thanks ASE_Test06.zip
  3. Hello, knows someone a good graphics or game engines for VB.Net? Important is me thereby e.g.: - loading of objects from 3ds max - shade computation -...
  4. :confused: what?!:confused: My english is not so good!!!
  5. Hello, knows someone a Tutorial or Sample, with which one I can show a file of ATI's RenderMonkey? Or knows someone, where I can found the source code of RenderMonkey? I would write gladly a VB.Net program (DirectX9), which indicates the effect file (*.rfx) of RenderMonkey as in the preview window. Please help me, thanks
  6. The Device.Present() is in 'Sub RenderEnvironment() That cannot be the error, because otherwise a blue window would also not be indicated. Public Sub Render3DEnvironment() If deviceLost Then Try ' Test the cooperative level to see if it's okay to render device.TestCooperativeLevel() Catch e As DeviceLostException ' If the device was lost, do not render until we get it back isHandlingSizeChanges = False isWindowActive = False Return Catch e As DeviceNotResetException ' Check if the device needs to be resized. ' If we are windowed, read the desktop mode and use the same format for ' the back buffer If windowed Then Dim adapterInfo As GraphicsAdapterInfo = graphicsSettings.AdapterInfo graphicsSettings.WindowedDisplayMode = Manager.Adapters(adapterInfo.AdapterOrdinal).CurrentDisplayMode presentParams.BackBufferFormat = graphicsSettings.WindowedDisplayMode.Format End If ' Reset the device and resize it device.Reset(device.PresentationParameters) EnvironmentResized(device, New System.ComponentModel.CancelEventArgs()) End Try deviceLost = False End If ' Get the app's time, in seconds. Skip rendering if no time elapsed Dim fAppTime As Single = DXUtil.Timer(DirectXTimer.GetApplicationTime) Dim fElapsedAppTime As Single = DXUtil.Timer(DirectXTimer.GetElapsedTime) If 0.0F = fElapsedAppTime And frameMoving Then Return End If ' FrameMove (animate) the scene If frameMoving Or isSingleStep Then ' Store the time for the app appTime = fAppTime elapsedTime = fElapsedAppTime ' Frame move the scene FrameMove() isSingleStep = False End If ' Render the scene as normal Render() UpdateStats() Try ' Show the frame on the primary surface. device.Present() Catch e As DeviceLostException deviceLost = True End Try End Sub 'Render3DEnvironment
  7. Hello, I has tries a C++ Tutorial in VB.Net to rewrite, but I see only a blue window. Can someone say to me, what wrong I make? In the attachment is the original cpp-file of the sample and the complete VB.Net project. Imports System Imports System.Drawing Imports System.Windows.Forms Imports Microsoft.DirectX Imports Microsoft.DirectX.Direct3D Namespace Direct3DTest2 Public Class MyGraphicsSample Inherits GraphicsSample 'Alles von Class GraphicsSample erben Public AnzahlObjekte As Integer = 2048 Public vbObjekte As VertexBuffer Public ibObjekte As IndexBuffer Public vCameraPos As Vector3 = New Vector3(0, 0, 0) Public CameraWinkel As Single = 0 Public Sichtfeld As Single = Math.PI / 4 Public Sub New() End Sub 'New Protected Overrides Sub FrameMove() End Sub 'FrameMove Public Sub RenderScene() Device.Transform.View = Matrix.LookAtLH(vCameraPos, New Vector3(vCameraPos.X + Math.Sin(CameraWinkel), vCameraPos.Y, vCameraPos.Z + Math.Cos(CameraWinkel)), New Vector3(0, 1, 0)) Me.Text = vCameraPos.X & "x" & vCameraPos.Y & "x" & vCameraPos.Z & "Winkel:" & 360 * CameraWinkel / Math.PI Dim Aspect As Single Aspect = Device.PresentationParameters.BackBufferWidth / Device.PresentationParameters.BackBufferHeight Device.Transform.Projection = Matrix.PerspectiveFovLH(CameraWinkel, Aspect, 0.1, 250) Device.Transform.World = Matrix.Identity Device.SetStreamSource(0, vbObjekte, 0) Device.Indices = ibObjekte Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, AnzahlObjekte * 8, 0, AnzahlObjekte * 12) End Sub 'RenderScene Protected Overrides Sub Render() Device.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Drawing.Color.Blue.ToArgb, 1, 0) Device.BeginScene() RenderScene() Device.EndScene() End Sub 'Render Protected Overrides Sub InitializeDeviceObjects() Try Device.VertexFormat = VertexFormats.Position Or VertexFormats.Diffuse Or VertexFormats.Texture1 Device.RenderState.Lighting = False Device.RenderState.CullMode = Cull.None Device.RenderState.DitherEnable = True Device.SamplerState(0).MinFilter = TextureFilter.Linear Device.SamplerState(0).MagFilter = TextureFilter.Linear Device.SamplerState(0).MipFilter = TextureFilter.Linear Dim tmpTextur As Texture tmpTextur = TextureLoader.FromFile(Device, "Texture.bmp", 256, 256, 1, 0, Format.Unknown, Pool.Managed, Filter.None, Filter.Linear, 0) Device.SetTexture(0, tmpTextur) vbObjekte = New VertexBuffer(GetType(CustomVertex.PositionColoredTextured), AnzahlObjekte * 8, Device, 0, CustomVertex.PositionColoredTextured.Format, Pool.Managed) ibObjekte = New IndexBuffer(GetType(Short), AnzahlObjekte * 36, Device, 0, Pool.Managed) Dim Verts() As CustomVertex.PositionColoredTextured Dim Indices() As Short Verts = DirectCast(vbObjekte.Lock(0, LockFlags.NoSystemLock), CustomVertex.PositionColoredTextured()) Indices = DirectCast(ibObjekte.Lock(0, LockFlags.NoSystemLock), Short()) Dim n, m As Integer Dim tmpPos As New Vector3 Dim StartVertex, StartIndex As Integer For n = 0 To AnzahlObjekte - 1 tmpPos.X = 250 * Rnd() + 20 tmpPos.Y = 250 * Rnd() + 20 tmpPos.Z = 250 * Rnd() + 20 StartVertex = n * 8 StartIndex = n * 36 Verts(StartVertex + 0) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + 1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 1) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + 1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 2) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + 1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 3) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + 1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 4) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + -1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 5) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + -1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 6) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + -1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 7) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + -1, tmpPos.Z + -1, 0, Rnd, Rnd) Indices(StartIndex + 0) = 0 : Indices(StartIndex + 1) = 3 : Indices(StartIndex + 2) = 7 Indices(StartIndex + 3) = 0 : Indices(StartIndex + 4) = 7 : Indices(StartIndex + 5) = 4 Indices(StartIndex + 6) = 2 : Indices(StartIndex + 7) = 5 : Indices(StartIndex + 8) = 1 Indices(StartIndex + 9) = 2 : Indices(StartIndex + 10) = 5 : Indices(StartIndex + 11) = 6 Indices(StartIndex + 12) = 1 : Indices(StartIndex + 13) = 0 : Indices(StartIndex + 14) = 4 Indices(StartIndex + 15) = 1 : Indices(StartIndex + 16) = 4 : Indices(StartIndex + 17) = 5 Indices(StartIndex + 18) = 3 : Indices(StartIndex + 19) = 2 : Indices(StartIndex + 20) = 6 Indices(StartIndex + 21) = 3 : Indices(StartIndex + 22) = 6 : Indices(StartIndex + 23) = 7 Indices(StartIndex + 24) = 0 : Indices(StartIndex + 25) = 1 : Indices(StartIndex + 26) = 2 Indices(StartIndex + 27) = 0 : Indices(StartIndex + 28) = 2 : Indices(StartIndex + 29) = 3 Indices(StartIndex + 30) = 6 : Indices(StartIndex + 31) = 5 : Indices(StartIndex + 32) = 4 Indices(StartIndex + 33) = 6 : Indices(StartIndex + 34) = 4 : Indices(StartIndex + 35) = 7 Next n vbObjekte.Unlock() ibObjekte.Unlock() Catch Dim e As New MediaNotFoundException HandleSampleException(e, ApplicationMessage.ApplicationMustExit) Throw e End Try End Sub 'InitializeDeviceObjects Protected Overrides Sub RestoreDeviceObjects(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub 'RestoreDeviceObjects Shared Sub Main() Dim d3dApp As New MyGraphicsSample If d3dApp.CreateGraphicsSample() Then d3dApp.Run() End If End Sub 'Main Private Sub MyGraphicsSample_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.Left CameraWinkel -= elapsedtime * Math.PI / 8 Case Keys.Right CameraWinkel += elapsedtime * Math.PI / 8 Case Keys.Up vCameraPos.X += Math.Sin(CameraWinkel) * 5 * elapsedtime vCameraPos.Z += Math.Cos(CameraWinkel) * 5 * elapsedtime Case Keys.Down vCameraPos.X -= Math.Sin(CameraWinkel) * 5 * elapsedtime vCameraPos.Z -= Math.Cos(CameraWinkel) * 5 * elapsedtime Case Keys.PageDown Sichtfeld += Math.PI * 10 / 360 * elapsedtime Case Keys.PageUp Sichtfeld -= Math.PI * 10 / 360 * elapsedtime End Select If Sichtfeld <= 0 Then Sichtfeld = Math.PI * 0.1 / 360 If Sichtfeld >= Math.PI / 2 Then Sichtfeld = Math.PI * 179.9 / 360 End Sub End Class 'MyGraphicsSample End Namespace 'Direct3DTest2 direct3dtest2_kap_02_5_buffer_new.zip
  8. I see only a blue window (Sorry I can't delete this thread) Hello, I has tries a C++ Tutorial in VB.Net to rewrite, but I see only a blue window. Can someone say to me, what wrong I make? In the attachment is the original cpp-file of the sample and the complete VB.Net project. Imports System Imports System.Drawing Imports System.Windows.Forms Imports Microsoft.DirectX Imports Microsoft.DirectX.Direct3D Namespace Direct3DTest2 Public Class MyGraphicsSample Inherits GraphicsSample 'Alles von Class GraphicsSample erben Public AnzahlObjekte As Integer = 2048 Public vbObjekte As VertexBuffer Public ibObjekte As IndexBuffer Public vCameraPos As Vector3 = New Vector3(0, 0, 0) Public CameraWinkel As Single = 0 Public Sichtfeld As Single = Math.PI / 4 Public Sub New() End Sub 'New Protected Overrides Sub FrameMove() End Sub 'FrameMove Public Sub RenderScene() Device.Transform.View = Matrix.LookAtLH(vCameraPos, New Vector3(vCameraPos.X + Math.Sin(CameraWinkel), vCameraPos.Y, vCameraPos.Z + Math.Cos(CameraWinkel)), New Vector3(0, 1, 0)) Me.Text = vCameraPos.X & "x" & vCameraPos.Y & "x" & vCameraPos.Z & "Winkel:" & 360 * CameraWinkel / Math.PI Dim Aspect As Single Aspect = Device.PresentationParameters.BackBufferWidth / Device.PresentationParameters.BackBufferHeight Device.Transform.Projection = Matrix.PerspectiveFovLH(CameraWinkel, Aspect, 0.1, 250) Device.Transform.World = Matrix.Identity Device.SetStreamSource(0, vbObjekte, 0) Device.Indices = ibObjekte Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, AnzahlObjekte * 8, 0, AnzahlObjekte * 12) End Sub 'RenderScene Protected Overrides Sub Render() Device.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Drawing.Color.Blue.ToArgb, 1, 0) Device.BeginScene() RenderScene() Device.EndScene() End Sub 'Render Protected Overrides Sub InitializeDeviceObjects() Try Device.VertexFormat = VertexFormats.Position Or VertexFormats.Diffuse Or VertexFormats.Texture1 Device.RenderState.Lighting = False Device.RenderState.CullMode = Cull.None Device.RenderState.DitherEnable = True Device.SamplerState(0).MinFilter = TextureFilter.Linear Device.SamplerState(0).MagFilter = TextureFilter.Linear Device.SamplerState(0).MipFilter = TextureFilter.Linear Dim tmpTextur As Texture tmpTextur = TextureLoader.FromFile(Device, "Texture.bmp", 256, 256, 1, 0, Format.Unknown, Pool.Managed, Filter.None, Filter.Linear, 0) Device.SetTexture(0, tmpTextur) vbObjekte = New VertexBuffer(GetType(CustomVertex.PositionColoredTextured), AnzahlObjekte * 8, Device, 0, CustomVertex.PositionColoredTextured.Format, Pool.Managed) ibObjekte = New IndexBuffer(GetType(Short), AnzahlObjekte * 36, Device, 0, Pool.Managed) Dim Verts() As CustomVertex.PositionColoredTextured Dim Indices() As Short Verts = DirectCast(vbObjekte.Lock(0, LockFlags.NoSystemLock), CustomVertex.PositionColoredTextured()) Indices = DirectCast(ibObjekte.Lock(0, LockFlags.NoSystemLock), Short()) Dim n, m As Integer Dim tmpPos As New Vector3 Dim StartVertex, StartIndex As Integer For n = 0 To AnzahlObjekte - 1 tmpPos.X = 250 * Rnd() + 20 tmpPos.Y = 250 * Rnd() + 20 tmpPos.Z = 250 * Rnd() + 20 StartVertex = n * 8 StartIndex = n * 36 Verts(StartVertex + 0) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + 1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 1) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + 1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 2) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + 1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 3) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + 1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 4) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + -1, tmpPos.Z + -1, 0, Rnd, Rnd) Verts(StartVertex + 5) = New CustomVertex.PositionColoredTextured(tmpPos.X + -1, tmpPos.Y + -1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 6) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + -1, tmpPos.Z + 1, 0, Rnd, Rnd) Verts(StartVertex + 7) = New CustomVertex.PositionColoredTextured(tmpPos.X + 1, tmpPos.Y + -1, tmpPos.Z + -1, 0, Rnd, Rnd) Indices(StartIndex + 0) = 0 : Indices(StartIndex + 1) = 3 : Indices(StartIndex + 2) = 7 Indices(StartIndex + 3) = 0 : Indices(StartIndex + 4) = 7 : Indices(StartIndex + 5) = 4 Indices(StartIndex + 6) = 2 : Indices(StartIndex + 7) = 5 : Indices(StartIndex + 8) = 1 Indices(StartIndex + 9) = 2 : Indices(StartIndex + 10) = 5 : Indices(StartIndex + 11) = 6 Indices(StartIndex + 12) = 1 : Indices(StartIndex + 13) = 0 : Indices(StartIndex + 14) = 4 Indices(StartIndex + 15) = 1 : Indices(StartIndex + 16) = 4 : Indices(StartIndex + 17) = 5 Indices(StartIndex + 18) = 3 : Indices(StartIndex + 19) = 2 : Indices(StartIndex + 20) = 6 Indices(StartIndex + 21) = 3 : Indices(StartIndex + 22) = 6 : Indices(StartIndex + 23) = 7 Indices(StartIndex + 24) = 0 : Indices(StartIndex + 25) = 1 : Indices(StartIndex + 26) = 2 Indices(StartIndex + 27) = 0 : Indices(StartIndex + 28) = 2 : Indices(StartIndex + 29) = 3 Indices(StartIndex + 30) = 6 : Indices(StartIndex + 31) = 5 : Indices(StartIndex + 32) = 4 Indices(StartIndex + 33) = 6 : Indices(StartIndex + 34) = 4 : Indices(StartIndex + 35) = 7 Next n vbObjekte.Unlock() ibObjekte.Unlock() Catch Dim e As New MediaNotFoundException HandleSampleException(e, ApplicationMessage.ApplicationMustExit) Throw e End Try End Sub 'InitializeDeviceObjects Protected Overrides Sub RestoreDeviceObjects(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub 'RestoreDeviceObjects Shared Sub Main() Dim d3dApp As New MyGraphicsSample If d3dApp.CreateGraphicsSample() Then d3dApp.Run() End If End Sub 'Main Private Sub MyGraphicsSample_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.Left CameraWinkel -= elapsedtime * Math.PI / 8 Case Keys.Right CameraWinkel += elapsedtime * Math.PI / 8 Case Keys.Up vCameraPos.X += Math.Sin(CameraWinkel) * 5 * elapsedtime vCameraPos.Z += Math.Cos(CameraWinkel) * 5 * elapsedtime Case Keys.Down vCameraPos.X -= Math.Sin(CameraWinkel) * 5 * elapsedtime vCameraPos.Z -= Math.Cos(CameraWinkel) * 5 * elapsedtime Case Keys.PageDown Sichtfeld += Math.PI * 10 / 360 * elapsedtime Case Keys.PageUp Sichtfeld -= Math.PI * 10 / 360 * elapsedtime End Select If Sichtfeld <= 0 Then Sichtfeld = Math.PI * 0.1 / 360 If Sichtfeld >= Math.PI / 2 Then Sichtfeld = Math.PI * 179.9 / 360 End Sub End Class 'MyGraphicsSample End Namespace 'Direct3DTest2
×
×
  • Create New...