Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Mar 2008
Offline Last Active Jan 22 2015 05:52 AM

#5203080 Cutting polygons by a grid.

Posted by eppo on 09 January 2015 - 07:25 AM

Simplest alternative to clipping would be to generate a triangulated volume of the boundary (if you don't already have a volumetric representation) using something like poly2tri. Then subdivide the mesh until all its edge lengths are below a certain threshold (to prevent too much distortion when you map its vertices to a sphere). If the map itself is triangulated you don't have to draw the sphere underneath it, avoiding possible intersection/z-fighting issues.

#5154069 How to draw [these kind of] splines?

Posted by eppo on 16 May 2014 - 12:01 PM

I suspect you'll be able to draw such a spline as a Hermite curve using only an outgoing and an incoming set of positions and (flat/horizontal) tangents.


You can use the Hermite routines that come with the D3DX-library.




Or you can use the cubic equations mentioned there directly.

#5152704 High Speed Quadric Mesh Simplification without problems (Resolved)

Posted by eppo on 10 May 2014 - 11:23 AM

Based on what criteria do you prioritize one contraction over the other? I don't see you (re-)sorting the list of triangles.

#5152524 Aligning a path, along a another dynamically

Posted by eppo on 09 May 2014 - 07:47 AM

This is probably easiest when the underlying road structure is defined as a network of interconnected splines. That way the center of the road and its tangent/direction are exactly defined. Also, you can do distance tests between the (tessellated) curve and surrounding points to see whether such points lie on the road. Lastly, a user-defined route becomes a simple series of (spline-)key-points.

#5151122 Having trouble with my Vertex Element Class

Posted by eppo on 03 May 2014 - 02:54 AM

What are the VertexElements you feed it with? Do elements that share the same semantic-name have individually unique indices? A name + index pair defines a unique semantic.


It would be less error sensitive if you don't have to specify a semanticIndex, but calculate it based on the number of previous occurrences of the same name.

#5149175 D3DXMatrixLookAtLH vs Custom View Matrix

Posted by eppo on 24 April 2014 - 09:26 AM

So basically the cross product for LH matrix doesnt seem to follow right hand thumb rule but rather left hand convention?


Yup. m_vecLookAtPoint faces away from you, so cross(LookAt, Up) would point to the left.

#5143499 Mapping problem onto a 2D quad

Posted by eppo on 31 March 2014 - 09:34 AM

If you specify a R16 format, the Input Assembler expects 16 bit floats. You'd have to do a manual float32-to-half16 conversion.

#5141972 Hitbox setup

Posted by eppo on 25 March 2014 - 05:51 AM

I see that whenever the boxes in the first picture align with the bones, their joints (spheres) in the rig-picture align as well.

The flat-laying boxes are the ones that seem to have axially aligned joints.

#5141679 Best way of volume selection

Posted by eppo on 24 March 2014 - 05:16 AM

How about a two-click mechanism? The first click lets you drag a rectangle of blocks over the XZ-plane, the second click scales along the Y-axis. This allows the user to create any combination of blocks.

#5140298 Shadow Map problem

Posted by eppo on 19 March 2014 - 06:00 AM

Are youe using a custom filtering kernel? seems to me you have a bug in the depth comparison method which causes results between neighbouring pixels in the map not to match up.

#5138891 Hitbox setup

Posted by eppo on 14 March 2014 - 03:22 AM

Given the three orthogonal axes defined by a bone matrix, you could search for extreme vertices that are affected by the bone in the underlying mesh. If you search in both the positive and negative directions you'll end up with six planes that form an oriented box. This box you can then transform into world space using the same matrices as used for the bones.


Or you can transform the box by the inverse of its bone matrix if you need an AABB that's positioned at the origin. Would take up less memory.

#5138656 Visualising 2D Fluids (passing data to the GPU)

Posted by eppo on 13 March 2014 - 05:10 AM

You simply cast the mapped resource to the same type as the view that describes it.


float* elementsOnline = (float*)mappedResource.pData;




memcpy(mappedResource.pData, elements, sizeof(float) * elementsCount);

#5138421 Visualising 2D Fluids (passing data to the GPU)

Posted by eppo on 12 March 2014 - 09:14 AM

What rendering API do you use?


In D3D you can read floats from a Texture Buffer Object defined as: Buffer<float> aBuffer;

#5138373 Visualising 2D Fluids (passing data to the GPU)

Posted by eppo on 12 March 2014 - 05:16 AM

You get a very obvious transition between spaces in and outside the volume, but perhaps you could do some post-process blurring and distortion like they do with volumetric cloud rendering.

#5138337 Displacement of vertex height from a grey scale texture on CPU

Posted by eppo on 12 March 2014 - 01:12 AM

A typical displacement map is sampled like any other texture: using a set of texture coordinates (like from a uv map). You can use adaptive tessellation to create additional vertices that sample this map in between the original vertices.


If you want to do a one-on-one mapping of 409 displacement values tied to 409 vertices it makes more sense to store them as a vertex-(weight-)-map and use them as a vertex shader input (next to position, uvs, etc.).