Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 Jan 2013
Offline Last Active Yesterday, 09:33 AM

Posts I've Made

In Topic: c++ function pointers

11 July 2014 - 01:51 AM

I find The Function Pointer Tutorials to be a good resource. Pros: an easy read, has examples, talks about functors. Cons: old, doesn't cover std::function.

Also missing: lambdas, mem_fn, bind. In modern C++, especially lambdas are a "must know", IMO.

In Topic: c++ function pointers

11 July 2014 - 01:46 AM

I second SiCrane, If you want to know what it would look like without typedefs, though:

int AddOne(int a)
    return a + 1;

int (*GiveMeFunctionPointer())(int)
    return &AddOne;
Function pointer types are weird. It sort of goes around the function declaration.


In the "new" standard (C++11), you can use a type alias instead of typedef:

using PF = int(*)(int);

Or, without typedef or alias, C++11 allows trailing return types; the syntax may be somewhat clearer:

auto GiveMeFunctionPointer() -> int (*)(int)
    return &AddOne;

In Topic: Jumping over to DirectX?

24 June 2014 - 03:16 AM

You could buy the book '3D Game programming with DirectX11' by Frank D Luna

That's a great book; far better than any online tutorial I've seen.

With one exception: Luna uses D3DX. kunos already mentioned the DirectX toolkit libraries; these should be used instead in new code.

In Topic: Why is infinite technically not a number.

02 June 2014 - 02:58 AM

There are ideas how to extend the field of real numbers to include infinity:


(The German article is more elaborate: http://de.wikipedia.org/wiki/Erweiterte_reelle_Zahl)

However, the usual arithmetic rules would no longer hold in such a field, because this set is no longer an ordered field:


So in practice it seem to be not very useful to work with such a definition.


Related question:

From a mathematical point of view: If you die young, are you longer dead?

In Topic: Matrix "sign"

05 May 2014 - 01:32 AM

So I guess that orthogonal matrices have some sort of "sign" property to them, that gives the handedness of the basis?

Definitely no.

The math doesn't care where the thumbs are attached to your hands. "Handedness" comes into play when you visualize the results in real world, e.g. on the screen. The identity matrix always looks like your 1st matrix.

Your 2nd matrix performs a mirror operation. In general, if the determinant is negative, the transformation includes mirroring.

In this sense, there is a relationship between this "sign" and handedness: To project vectors from left- to a right handed coordinates, you can use a mirror operation.