   D3DXMESH and Directx10
  I was about to transistion from a custom simple 3d object to using meshes. So I look through the tutorial and samples for meshes in DX10. It appears that they do not even use D3DXMESH anymore, but rather thier own undecypherable SDK_MESH object instead. Does this mean we are encouraged to stop using D3DXMESH and create our own Mesh data structure? I don't mind doing it, I would even like to, but where do I start on the intersection testing that I would be missing?I'd really like to get back the subset or even the face of the mesh that a vector intersects with. I fear my algorithm would be really poor. All I can think of is to start with a surface that outlines all the faces of each subset, determine which subset if any was intersected, and then iterate through all the faces of that subset to determine which face. That assumes I can figure out how to get one surface, comprised of outside edges, from a set of faces.That also assumes I can figure out how to test an intersection of a ray and a surface.   
  It's not called D3DXMESH, it's ID3DX10Mesh in DX10. The mesh helper functions are a little spare compared to DX9, but there are still some useful functions (such as D3DXIntersectTri).   ;Quote:Original post by brekehanIt appears that they do not even use D3DXMESH anymore, but rather thier own undecypherable SDK_MESH object instead. Does this mean we are encouraged to stop using D3DXMESH and create our own Mesh data structure?Mesh formats seem like an increasingly messy story really. The traditional .X format has had no love in many years, then they create this proprietary sdkmesh format for the SDK samples with a warning that it shouldn't be used in production environments. Kill one, add a new one - what do they expect people to try and do?? [rolleyes]But yes, my take on the situation is to roll your own or explore other mesh libraries. Microsoft don't have enough pressure to provide us with one (or continue the previous .X format) so waiting on them isn't likely to be worthwhile...Quote:Original post by brekehanwhere do I start on the intersection testing that I would be missing?You start from scratch unless you can find any other mesh or math libraries that expose this for you.Quote:Original post by brekehanI fear my algorithm would be really poor. All I can think of is to start with a surface that outlines all the faces of each subset, determine which subset if any was intersected, and then iterate through all the faces of that subset to determine which face.Heirarchical rejection is usually the best win for ray-mesh intersections. Do fast tests on entire subsets using bounding spheres (for example) and immediately reject any that fail. For enclosed solid geometry you can reject triangles that are back facing pretty quickly as well. Think of it entirely in terms of how you can reject as many triangles as quickly as possible.Quote:Original post by brekehanThat also assumes I can figure out how to test an intersection of a ray and a surface.This has been in graphics textbooks and tutorials online for decades so you won't find any shortage of references to work from. This style of mathematics is heavily used in ray tracing, so any introductory text on this is likely to cover the basic permutations of ray-* intersection.hthJack;Quote:Original post by jollyjeffersMesh formats seem like an increasingly messy story really. The traditional .X format has had no love in many years, then they create this proprietary sdkmesh format for the SDK samples with a warning that it shouldn't be used in production environments. Kill one, add a new one - what do they expect people to try and do?? [rolleyes]Do the sensible thing and switch to XNA, which has built-in support for the solid, broadly used FBX format? [smile]Seriously though, it does make one wonder why they went out of their way to create the SDKMesh format, when they could have just as well added FBX support to vanilla DirectX. That would probably have been a lot more useful. If only we knew an MVP to give them a push in this general direction... [wink];Quote:Original post by remigiusDo the sensible thing and switch to XNA, which has built-in support for the solid, broadly used FBX format? [smile]I despise XNA. I tryed it more than 5 times and could not accomplish even the simplest of things that I could with the DirectX C++ API.   ;Quote:Original post by jollyjeffersThis has been in graphics textbooks and tutorials online for decades so you won't find any shortage of references to work from. This style of mathematics is heavily used in ray tracing, so any introductory text on this is likely to cover the basic permutations of ray-* intersection.Can you recommend one?My internet searches all yield complex algorithms and equations without first mentioning how they got those equations, what variables they are dealing with, etc. I've been programming for years, but geometry is not my strong point.;Quote:Original post by brekehanI despise XNA. I tryed it more than 5 times and could not accomplish even the simplest of things that I could with the DirectX C++ API.Sorry, I didn't mean to tick you off. It was more of an introduction to my own puzzlement why they didn't go with the FBX format for the DirectX C++ API, but chose to implement the SDKMesh thing instead.Quote:My internet searches all yield complex algorithms and equations without first mentioning how they got those equations, what variables they are dealing with, etc. I've been programming for years, but geometry is not my strong point.I had the same problem, but I found the best way to go about learning these algorithms is with a book. A good one will give you the required math background and build on that to gradually get to the more complex algorithms. I personally found this book pretty good to brush up my math, but although it has a few (very useful) chapters on the subject it doesn't go too deep into intersection testing. From what I hear, this book is a good reference is you mostly want to focus on intersections.;Quote:If only we knew an MVP to give them a push in this general direction...[looksaround] I can see what I can do, but I wouldn't hold your breath - they mostly respond to the industry partners for these sorts of change requests. Not to suggest they don't care about the wider hobbiest community, but purely as a business function their bigger partners get more weighting on priorities...Quote:Can you recommend one?My internet searches all yield complex algorithms and equations without first mentioning how they got those equations, what variables they are dealing with, etc. I've been programming for years, but geometry is not my strong point.This one has been a personal favourite for years and there are two others - this and this one. I have all three and they've served me well.hthJack   ;Quote:Original post by jollyjeffersQuote:If only we knew an MVP to give them a push in this general direction...[looksaround] I can see what I can do, but I wouldn't hold your breath - they mostly respond to the industry partners for these sorts of change requests. Not to suggest they don't care about the wider hobbiest community, but purely as a business function their bigger partners get more weighting on priorities...Fair enough. It's not much of an issue for me personally since I'm camping out on the XNA front anyway, but supporting an actually useful format might also help bigger parties in low-budget prototyping. The SDKMesh format is useless for either party, so it's a bit of a shame their time got sunk into that. Thanks for offering to converse with the powers that be, but if you feel it's not realistic or not useful, don't let me push you [smile]