# Earthmark

Member

24

198 Neutral

• Rank
Member
1. ## Octrees == accordions

Thank you, I will certainly try it!
2. ## No clue what to call this, any help welcomed

Thank you for the ideas with the octree, they are a heck of a good idea. However at this point we are not even at that point. The issue we are having at this point is changing the tree, as posted here: http://www.gamedev.net/topic/646244-octrees-accordions/
3. ## Octrees == accordions

So, take two.   The terrain is generated into an octree that looks like this: Now this is a quadtree, but it is the same idea can is easily applied to three dimensions. With this image the red line is the terrain surface, what you actually stand on. The green is leaf nodes, that contains part of the mesh. In this process each leaf would contain one point, or vertex, that is connected to its neighbors creating the actual terrain.   To show this a bit better than the previous general image, here is a snip from the dual contouring paper. With this you can see each vertex, and how it would connect to form a mesh. Now with this you can see that there that many of the vertices are not really needed, they link to other points in a nearly straight line. So in order to optimize the mesh we can collapse a leaf into this: As you can see there is only one vertex here, rather than 4. This is a save on both memory and processing time and therefore a very good idea to do. However there is an issue with doing this; To generate the original node, with all five vertices, you need some data that looks like this: Where each edge contains a position, and a normal pointing outwards from where the surface will be. Using this it positions the vertices to build the surface. Please note that once those points are generated though, they are merged into a matrix that looks like this: Now this is after some operations were applied to it, and the data (represented where each row was the normal in the first three columns, and the dot of the normal to an average of the positions in the fourth column) has been pulled up into this triangle through some fancy operations. Most of this you don't really need, the only important bit is that this is generated from the arrows above, and once it is made the arrows are only needed if the matrix needs to be rebuilt.   Now this matrix is used for simplification and leaf compression, you can see the process in detail through the link in the top post. The issue is that when you compress a leaf you only need use that matrix to compress it. And if the arrows are kept then each collapsed node would take more and more memory as it has to store more and more arrows.   If the mesh was never changing this would not be a problem; However if say you wanted to change the terrain, carve it or shape it, you would need to get those arrows back in order to build that matrix again with really small leaves, then compress back up.   In a few general cases this would not be a problem, the original arrows are made using a noise function and can easily be replicated. However if you modify a surface (cut out a shape, fill a shape), the surface is simplified, and then you modify again; where will it get the arrows from?   I am just trying to find a good way to solve this without killing the memory usage. I get a feeling there is a trick with the matrix that I just don't understand.... if you have any ideas please let me know.
4. ## Matrices and their singular values...

Thank you, however it still seems too complicated to try to translate, I found MathNet.Numerics as a native C# library, and i think it has an SVD system in it. Thank you for the quick response though.
5. ## Matrices and their singular values...

So when building a mesh in Dual Contouring, I am having to compute the singular value decomposition of an upper diagonal 3x3 matrix. However every paper I have seen for doing that computation has confused the crap out of me.   If anyone knows of any libraries, or easier to follow sources for computing the SVD please let me know.
6. ## Octrees == accordions

In dual contouring, (as defined in here) terrain can be shown as an octree where the leaves contain a vertex of the mesh. However in order to save memory the mesh needs to be minimized, or similar leaves are collapsed into a single, larger, leaf. The paper discusses this and it makes sense, however another problem arises;   if you want to modify the mesh, by carving it using some sort of shape, then you may need to split that larger node down again. The issue with this step is that when a node is split again, how would you then rebuild the 'hermite data' that those smaller nodes use?   The far edges of the larger node would already contain 'hermite data'; however the new edges, on that are inside of the larger node, would need to be generated somehow.   Please let me know if I'm doing this wrong or if you have any ideas!
7. ## MEF and releasing imports.

That seems to have done it. Looks as though having that attribute is now mandatory, oh well.    Thank you Leandro.
8. ## MEF and releasing imports.

I am attempting to use MEF to load content in a program, the point is that the program is extendable so that additional modules can be easily added. However I am having trouble with MEF returning the same object repeatedly, I am not using Import attributes and am instead using the manual import methods.   I am using a custom export attribute for the classes to be composed. [AttributeUsage(AttributeTargets.Class), PartCreationPolicy(CreationPolicy.NonShared)] public sealed class ItemExportAttribute : ExportAttribute { public ItemExportAttribute(string name) : base(name, typeof(Item)) {} } Even though I am using NonShared the same export keeps being provided, I am also composing subparts that change between calling GetExportedValue, so every object should be different. However even stepping through the debugger the constructor is only called once. Also without the NonShared policy an exception is thrown when it attempts to import an object with the same contract twice.   As far as I can tell this is mostly caused by not calling the ReleaseExport method on the CompositonContainer, however that seems rather intensive and fairly roundabout to the point where I get a feeling I'm wrong on what these parts do. Edit: Turns out that does not fix the problem, it still only outputs one object.   Does anyone know a way to get imports without requiring every export to then be released again directly after it is imported?
9. ## Xml Schema inheritence

So, Is there a way to show inheritance in an XML schema; by using the name of the element to represent the type, and allow it to include types defined in an additional schema that "extends" the first. Currently I have only found that including every possible type in a <choice> element works, but its not extendable if additional types are defined in side schemas.
10. ## XNA to C++

If you know the XNA api you might want to try SharpDX. It's more or less a clone of the DirectX api, like XNA is, but it currently supports up to DirectX 11.1. Also most of the library locations are somewhat similar so it's not too bad to convert. I can't remember the name but I think there is another C#/DirectX based library if SharpDX doesn't float your boat.   EDIT: I was thinking of SlimDX, but it is out of date.
11. ## Dual Contouring octree enumeration.

I have been following http://www.frankpetterson.com/publications/dualcontour/dualcontour.pdf to impelement duel contouring. However up until this point it was over a uniform grid; Now I am attempting to implement it over an octree and am very confused on the paper's enumeration method. (page 6 of the paper)   I understand up until how you are supposed to use the minimal edge, if it was two adjacent cubes you could test if the surface intersected between them and generate that 'quad', covering that area of the surface, however their use of four cubes around an edge loses me. The main issue I am having is, under this implementation, are they attempting to find the surface perpendicular or parallel to the four nodes; and to that end how do they plan to hook up the connecting 'quads' when the endpoints of that line would be one of the vertices of the 'quads'. Please help.
12. ## QEF's and the SVD decomposition.

Ok, Thank you.
13. ## QEF's and the SVD decomposition.

I am attempting to implement Dual Contouring, as defined in http://www.frankpetterson.com/publications/dualcontour/dualcontour.pdf   However the part with the SVD decomposition confuses me. I found a few libraries that can do the decomposition but then it gets confusing again when it discusses truncation (more of why it should be, not what it is), and in particular what values are being truncated.   I know this is not much to go on, I apologize for that however any help would be appreciated.

Thank you.
15. ## Dual Contouring and QEF's

Upon reading the journal found here, in section 2.3 the matrix Q can be "expressed as the product of a sequence of Givens rotations" I have never heard this terminology used with matrices, If possible please help to define what it means.