Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Jun 2002
Offline Last Active Yesterday, 03:30 AM

Posts I've Made

In Topic: Why std::copy is faster than std::memcpy ?

19 September 2015 - 06:05 AM

Nice to know, but since the compiler optimize for memcpy, it's safer to always use memcpy, true ?About the timer, good point, I should stop to use SDL timer and implement a custom one with better precision.

If you are in C++, you should use std::copy. memcpy is dangerous, it doesn't invoke copy or move constructors, and completely ignores type safety.

For any relatively trivial pod type, the compiler will probably just replace std::copy, or a simple for loop copy, with an intrinsic memcpy.

In Topic: Maya Rotations

17 September 2015 - 04:27 PM

Ok, so you can't do this with eulers.

Convert each transform into a world space matrix (for each key frame).

Create a scale matrix with -1 in z.

Pre AND post multiply each world space matrix by your scale matrix.

The matrices are now correct.

You'll now need to transform each matrix by the inverse of its parent.

From there you should have a local space matrix, which can be decomposed into a local space rotation (as a quat), local space scale, and local space translate. Euler angles will fuck up terribly, use quats.

If you make heavy use of scale and rotate pivots, this approach might start to fall apart for you.

If you have no scale in your transforms, then you can get away with negating the z translation, and X and y values of all quats (once they have been computed in world space). This will work, but its not great. You always end up doing mental gymnastics to convert between game and model coordinate systems.

To be honest though, if maya is your only DCC package, you only need to reverse the polygon winding (cull front faces, not back), and set a right handed projection matrix. And then, you are in a right handed world.

In Topic: Examples of win32 Gui code?

17 September 2015 - 04:11 PM

Qt is the way to go in the long run. If it's a quick and dirty gui you want (over a simple tool), a windows forms GUI that calls a C++ command line app is hard to beat. (Effectively the gui just builds up the command line args)

In Topic: Software Fallback?

11 November 2014 - 09:10 AM

AFAIK, HD 3xxx series should go up to OpenGL 3.1 on Windows, 3.3 on Linux with Mesa. Not sure what's the situation in OSX world, didn't they supported up to 3.2 with those cards?


Technically 3.1 (due to a few missing features from 3.2 and 3.3), but the HD 3000 supports version 400 GLSL strangely.

In Topic: DLL Import Failure

18 July 2014 - 10:15 AM

Right, but what if I wanted to use 2 DLLs in the same project, and one is 32 bit and the other is 64 bit, is it impossible to make any program that will use both DLLs?  That seems absurd.


If you need to mix 32bit + 64bit DLL's, then the only option you have is to use an IPC approach (pipes, named pipes, network socket), and use that to connect two applications together. It's neither nice, nor fun. Ditch the 32bit DLL and move on.... :)