Jump to content
Xtreme .Net Talk

Kavan

Avatar/Signature
  • Posts

    71
  • Joined

  • Last visited

Everything posted by Kavan

  1. First make sure you're using debug libraries as pointed out in another thread. First thing to check is if you release all resources in default pool. Other than that debug output will give you the most information.
  2. You probalby didn't install DirectX with /InstallManagedDX flag.
  3. Create a VertexBuffer, an array of vertices. Fill the vertices with data and set data to the VertexBuffer. Check the documentation. Although it's scarce I think there's a howto about this.
  4. Use a screen sized quad and change it's alpha.
  5. I'm for a .NET solution myself. I have a VB.NET like scripting language that I convert into regular VB.NET code with some regular expressions. Then I just use the compiler that is available programmatically from the framework to generate the assemblies.
  6. Have you tried enabling unmanaged code debugging and then breaking the program during the hang?
  7. You also have to fill the index buffer.
  8. You can't have two elements with same usage and usage index combination. I guess you have to use position, normal, binormal (the second normal), tangent as RobyDx suggested. As I said I haven't done tweening myself. Perhaps it'll work if you just use position for both but with different usage index (0 and 1). Of course you still need correct stream index and offset. Hope this makes sense.
  9. I haven't done vertex tweening with multiple streams, but have other things working with multiple streams. So I'll just tell you the general procedure of moving things to multiple streams. First make it work with one stream as RobyDx said. Then all you have to do is change the stream index in vertex declaration for the appropriate vertex elements and modify offsets to reflect real offset in the corresponding vertex buffer. Then just set stream source to each of the vertex buffers and it should work.
  10. You'll have to create a new vertex declaration as the presence of normal will change the offset of the texture information from 12 to 24. The same for position only (here you don't even have en element for texture coordinates).
  11. Use Vector3.Unproject. Compute result on Vector3(mouseX, mouseY, 0) and Vector3(mouseX, mouseY, 1), the other parameters fetched from device. This gives you a ray in world space as defined by the mouse position. You can compute the intersection of this ray with your plane, giving you a 3D position of the mouse. Computing this at two times and subtracting it gives you the amount you have to move with the view matrix.
  12. Speaking of game engines you can check Artificial Heart at http://www.3dlevel.com/artificialheart.php.
  13. It usually isn't the problem that managed code would be slow. More usually it's lack of general DirectX knowledge. I doubt you would create any faster apps would you be coding in C++.
  14. That is the value you initialize z-buffer with. It ranges typically from 0 (front) to 1 (back). It is used internally to determine if the new stuff should be rendered. It is rendered only if its depth is closed to camera than z-values already in the z-buffer. So when you set it to 0 you effectively said that there is a plane right in front of the camera meaning that nothing behind it could be seen.
  15. It would be even easier to just use Mesh.Intersect.
  16. You will have to lock the surface, read the colors, and set the appropriate heights in your vertex data. Make sure you take a look at the billboard sample in the sdk. A good starting point for terrain visualizations is http://www.vterrain.org. It's not about Managed DirectX in particular but has general algorithms that you might find useful.
  17. Just make sure you have a surface with an alpha channel. Then when you clear the render target just set transparent color for background (I'm assuming you're rendering to surface). Anyway a better way of doing this all would be to have a dynamic vertex buffer and streaming in only vertex data you need with correct colors.
  18. If you're combining with DirectPlay then you should be using binary format. There's a known problem if a user is having non english regional settings that screws up the loaded text x files when using Direct3D in combination with DirectPlay.
  19. They were probably mapping C++ RECT structure to .NET Rectangle by copying memory. And here's the problem. RECT is defined by x1,y1,x2,y2 while Rectangle is defined by x1,y1,width,height. By the way, this will be solved in the Summer Update 2004.
  20. You will want to modify the alpha component of your material color. Also set the correct alpha blending render states if you don't already.
  21. The only way you benefit from this is if you merge several models into a single mesh. Just applying the world matrix and afterwards setting an identity matrix will not save you anything. If you go into merging then keep in mind that merging too many models will not be good if you don't actually see all of it. It is better to keep it smaller and apply visibility tests on it. The way to actually do all this is by creating a new mesh. Then lock the source vertex buffer and copy data to the locked buffer of the new mesh. Apply transformation while doing this. I would reccomend that you use GraphicsStream for this. Do the same with index buffer (correctly modify the indices) and attribute buffer. I haven't gone into details as that would sure be enough talk for a whole article.
×
×
  • Create New...