Jump to content

  • Log In with Google      Sign In   
  • Create Account

quasar3d

Member Since 01 Dec 2001
Offline Last Active Apr 12 2013 04:48 PM
*----

Posts I've Made

In Topic: Does anyone use fixed point math anymore?

13 March 2013 - 02:50 AM

In addition to the uses for fixed point already stated (e.g. large worlds,) it is also used to make code deterministic across machines/platforms/etc.

It is possible to do this with floating point code but your milleage may vary (in my experience it is challenging.)

One example of this is RTS games where inputs are broadcast to all clients and each client must update their state and stay in sync.

 

 

 I actually experienced floating-point determinism being varied across machines in an engine which 'planted' trees around terrain at game load time using a procedural method of creating potential points all over the terrain and checking the slope of the ground at those points one at a time before generating a new point to test, and in some cases it would throw off the scene generation algorithm so wildly that the two machines in the same game would be in two geometrically different worlds due to the PRN code becoming out of sync when some trees would get planted and others wouldn't based on floating point precision nuances in the slope check.

 

If both were running the same executable, then this really can't happen. The result of a floating point instruction is defined exactly (the rule is that it should return the nearest floating point number to the exact result, and round to even on ties). Also, if you don't have options like fast math enabled, then the same thing is true for C/C++ code (at least if it's IEEE 754 compliant), so it's likely that this difference was caused by something else.


In Topic: Cross Product of Many Vectors

11 March 2013 - 06:21 AM

This is exactly what least squares solves.


In Topic: computer vision

24 January 2013 - 03:34 AM

First hit on google for "computer vision book" gives<br /><br />http://szeliski.org/Book/<br /><br />where you can download a pdf for free!

In Topic: Calculating the required rotation.

04 January 2013 - 07:34 AM

There's indeed a most natural rotation. It's the one that leaves vectors perpendicular to the plane of A and B invariant.

To derive such a matrix, note that any composition of 2 (or any even number of) reflections is a rotation. With this, you can easily construct a matrix that satisfies your requirements.

Let S_1 be the matrix that reflects A to -A, and let S_2 be the matrix that reflects A + B to -(A + B). The composition S_2 S_1 is then your rotation matrix.

In vectors, reflecting a vector x in a normal vector n is

{eqn} x' = x - 2 n (n \cdot x) {/eqn}

or in matrix notation, where vectors are column vectors

{eqn}
x' = x - n (n^T x)
= (I - n n^T) x
{/eqn}

so your reflection matrix is then {eqn} I - n n^T {/eqn} so your rotation matrix, which rotates a to b

{eqn} R = (I - \frac{(a + b) (a + b)^T}{|a + b|^2)(I + \frac{a a^T}{|a|^2}) {/eqn}

EDIT: Can't get latex to work

In Topic: point cloud to low polly mesh

04 September 2012 - 03:50 AM

I once implemented this algorithm:

http://www.cs.ucdavi...nta/pubs/sm.pdf

and it worked quite well (although it was far from real time).

I haven't implemented other algorithms, so I can't tell you how it compares to other methods. Just do a google search for surface reconstruction, which should give you loads of papers about it.

PARTNERS