Jump to content

  • Log In with Google      Sign In   
  • Create Account

Christer Ericson

Member Since 05 Sep 2004
Offline Last Active Dec 30 2011 05:08 PM

Posts I've Made

In Topic: Per pixel point light: interpolating vertex world pos

29 December 2011 - 11:44 PM

You will get the same results by interpolating the positing and then computing the light direction in the pixel shader...this is because vertex positions can be linearly interpolated. So you don't have anything to worry about.

I don't think you meant to say "same results", Matt. Interpolating the vertex positions and computing a light direction in the pixel shader will not give the same result as computing a light direction at each vertex and interpolating these vectors over the triangle. The former is correct while the latter is incorrect, in the sense of the resulting vector accurately pointing at the light source. You might say "similar results" in that interpolating the direction vectors isn't grossly inaccurate (for some definition of grossly).

In Topic: Does anyone know how to prove this algorithm for Collision Detection

29 December 2011 - 11:32 PM

So my Question is : How can I get the Mathematical proof?

You prove the separating axis test by a) looking at how many ways the two convex objects can come into contact, and then b) making sure you have tested for separating for all those possibilities. If, after you have performed all those tests, you have not found the objects separated, you must conclude they are intersecting.

For two convex polygons in 2D, you will find that the polygons can come into contact with their vertices and along their edges, and that it is sufficient to test separation with planes that are parallel to the edges of the polygons (or, equivalently, along axes that are parallel with the edge normals). This means you perform at most M + N separating axis tests for a 2D intersection test of a convex M-gon and a convex N-gon.

In Topic: Fixed Point Arithmetic in architectures wit FPU

25 September 2010 - 03:39 AM

Dave, that's not how I interpreted alvaro's statement. I think he's aware of the guarantees of IEEE-754.

A real problem is that with floating-point you can well get different outcomes for the same configuration centered at (0,0) versus at (100000, 100000) for simple problems like "is point P left of line segment AB". With fixed-point you would get consistent answers, i.e. "reproducibility of results".

In Topic: Fast Unique Vertex Determination

08 August 2010 - 04:57 PM

I wouldn't recommend sorting and pruning. The most elegant solution (which also happens to be the most efficient solution) is to insert the vertices one by one into a spatial hash table and remove duplicates as they are encountered. Basically what sebbit suggested, except properly detecting duplicates with respect to a floating-point comparison threshold.

For detail, see:
http://groups.google.com/group/comp.games.development.programming.algorithms/msg/d6d2a2b98209e013

If that's not enough detail, you can also see Chapter 12.1 of my book for a lengthy elaboration.


In Topic: 4x4 reflection matrices

27 July 2010 - 05:28 PM

The second half of this article covers exactly what you're asking about: http://realtimecollisiondetection.net/blog/?p=16.

PARTNERS