spiffycrony

Members
  • Content count

    70
  • Joined

  • Last visited

Community Reputation

122 Neutral

About spiffycrony

  • Rank
    Member
  1. I am drawing a model on the picture box using directx8. I think using glViewport of opengl we can draw to a particular region in a window say only the top half of the window. Is there a similar function in directx to draw only to the top half of the picture box or something similar to glViewport?
  2. Geometry.ComputeBoundingSphere Directx

    Thanks remigius. When I scaled the model by say 10 then the Geometry.ComputeBoundingSphere and also the mesh.clone works fine. The minxyz - -260.49, -83.99997, -70.0 and maxxyz - 222.11, 84.00003, 70.0 which are all small enough to fit into a float data type. So I dont think it can cause an overflow. But still I couldnt find the reason as to why without scaling it causes problem in Geometry.ComputeBoundingSphere and mesh.clone(where some vertex coordinates are QNAN)
  3. I am creating a mesh for the text and rendering it. LocalFont = New System.Drawing.Font("MS UI Gothic", 16.0, Fontstyle.Regular, GraphicsUnit.World, 100) Mesh_Font = Mesh.TextFromFont(direct3DDevice, LocalFont, Name, 0.001F, 0.01F) How to change the size of the text getting displayed? I was changing the second parameter of the System.Drawing.Font, but the text size remains fixed. Any suggestion of how to change the text size?
  4. I am loading a mesh object with a directx x file as follows Dim mesh_ = Mesh.FromFile(MyBase.OutputFile, MeshFlags.Managed, device) When I get the vertex and check the coordinate values, some vertex coordinate values are NAN while the coordinate values in the x file are correct. I get it as follows mesh_ = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) Dim source() As CustomVertex.PositionNormalColored = mesh_.LockVertexBuffer(GetType(CustomVertex.PositionNormalColored), 0, mesh_.NumberVertices) Any clue of why some of the vertices coordinate values become NAN?
  5. I am trying to compute the object radius & centre using Geometry.ComputeBoundingSphere for a mesh object. This works fine for a small mesh say few hundreds of triangles. But for a larger say few thousands of triangles the objectRadius returned is 0 & objectcenter is NAN(not a number). Any clue of why this is happening? Dim vb As VertexBuffer = mesh_.VertexBuffer Dim vertexData As GraphicsStream = vb.Lock(0, 0, LockFlags.NoSystemLock) objectRadius = Geometry.ComputeBoundingSphere(vertexData, mesh_.NumberVertices, mesh_.VertexFormat, objectCenter) vb.Unlock() vb.Dispose()
  6. Mesh.Clone directx

    The innerexception is nothing. The exception details are as follows ErrorString "D3DERR_INVALIDCALL" String InnerException Nothing System.Exception Message "Error in the application." String Source "Microsoft.DirectX.Direct3DX" String
  7. Mesh.Clone directx

    The exception is ApplicationException. The error message is "Error in Application".
  8. Mesh.Clone directx

    I am getting an exception in the following line Dim Mesh2 As Mesh = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) This happens when i convert a huge binary stl file into directx x file and then load the mesh_ with the x file data. However it works fine with small binary stl file. Is there any limitation on the no of facets which can be loaded into a directx mesh object. Any idea of why the exception occurs?
  9. I am drawing the font as follows dim LocalFont As System.Drawing.Font dim Mesh_Font As Mesh LocalFont = New System.Drawing.Font("MS UI Gothic", 16.0, Fontstyle.Regular, GraphicsUnit.World, 100) Mesh_Font = Mesh.TextFromFont(direct3DDevice, LocalFont, Me.Name, 0.001F, 0.01F) Mesh_Font.DrawSubset(0) How to vary the font size which is drawn. The second parameter in System.Drawing.Font seems to be em size. But when i change this value, still the font size is not changed. Any idea?
  10. I am loading a x files as follows Dim mesh_ = Mesh.FromFile(MyBase.OutputFile, MeshFlags.DoNotClip, device) Is the second parameter meshflags related to updation of the mesh normals?
  11. Loading x files

    I am loading a directx x file into a Mesh object as follows Dim mesh_ = Mesh.FromFile(MyBase.OutputFile, MeshFlags.DoNotClip, device) When i get the vertices as follows the normal values are 0. Dim Mesh2 As Mesh = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) mesh_ = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) Mesh2.Dispose() Dim source() As CustomVertex.PositionNormalColored = mesh_.LockVertexBuffer(GetType(CustomVertex.PositionNormalColored), 0, mesh_.NumberVertices) How to make sure the normals are updated in the mesh object when loading from directx x file?
  12. I am drawing a text on the form using the following code LocalFont = New System.Drawing.Font("MS UI Gothic", 16.0, Fontstyle.Regular, GraphicsUnit.World, 100) Mesh_Font = Mesh.TextFromFont(direct3DDevice, LocalFont, Name, 0.001F, 0.01F) Mesh_Font.DrawSubset(0) I expected the text size to change when i change the 2nd parameter of the font() constructor from 16 to say 10. But the text size remains the same?
  13. I want to create a directx mesh object by reading the data from stl file. Is there an api to do this similar to x files? or Should i read the stl file and write it as an x file and use the existing x file api?
  14. Directx version 9.0 & 9.1 problem

    Is there an alternate way to draw the text i.e instead of using Mesh.TextFromFont?
  15. I am getting an unhandled exception in the following line Dim mfont As Mesh = Mesh.TextFromFont(device, lfont, "name", 0.001F, 0.01F) where lfont is defined as Private lfont As System.Drawing.Font = New System.Drawing.Font("MS UI Gothic", 16.0, Fontstyle.Regular, GraphicsUnit.World, 100) The exception is An unhandled exception of type 'Microsoft.DirectX.Direct3D.Direct3DXException' occurred in microsoft.directx.direct3dx.dll Additional information: Error in the application. I am using .net and directx. This problem happens only with the directx version v9.00.0900(9.0) and it works fine with version v9.00.1126(9.1). Now since the clients are using the older version i am trying to find if it can be fixed. I used the debug view(thanks to remigus). The output is as follows [1468] D3DXCreateText: GetOutlineTextMetrics failed. Probably no font selected [1468] D3DXCreateText: CreateOFContext failed Anyone having any idea on what can be the problem?