Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Mar 2012
Offline Last Active Yesterday, 11:33 AM

Topics I've Started

Visual Studio 2013 _tmain ?

13 June 2014 - 10:23 PM

After several years of not using windows i find myself having to use visual studio 2013 (The last edition i used was visual studio 2008). To my surprise, my simple console application will not compile. It is complaining about a missing _tmain function. After checking out the default project that gets generated, i renames my main function from

 int main(int argc, char *argv[]) {


int _tmain(int argc, _TCHAR* argv[]) {

And everything now works...


When did this change happen?

What was the reasoning behind this? Why not just keep regular old main?


Is there any way to use the standard main function? I hate having #if statements just for windows....


Can anyone please shed some light on this matter for me?

LUA load file into table

07 May 2014 - 03:00 PM

This question relates to the lua c api. Lets say i have a file like this one: 

helloString = "Hello World"

function fwrite (fmt, ...)
     return io.write(string.format(fmt, unpack(arg)))

And i want to load it into a global table named loadedScript such that at a later point i can call fwrite like loadedScript.fwrite

Ideally i would like to load the file and assign it's contents to the global table trough the C API.


I'm new to lua, and have no idea what to even look for to solve this.

Anyone have any ideas?

glm matrix layout

17 February 2014 - 08:21 PM

Does anyone know the matrix layout for glm? I know it's laid out linearly in memory, i'm wondering where the basis vectors are. 


To my knowledge it looks like this

Xx, Xy, Xz, 0

Yx, Yy, Yz, 0

Zx, Zy, Zz, 0

Tx, Ty, Tz, 1


So, assuming a linear array of memory

flat* matrix = glm::value_ptr(mat);


The right vector would be row 1

glm::vec3 right = glm::vec3(matrix[0], matrix[1], matrix[2]);


The up vector would be row 2

glm::vec3 up = glm::vec3(matrix[4], matrix[5], matrix[6]);


The forward vector would be row 3

glm::vec3 forward = glm::vec3(matrix[8], matrix[9], matrix[10]);


and the position would be row 4

glm::vec3 position = glm::vec3(matrix[12], matrix[13], matrix[14]);



Also, how would one go from a 4x4 matrix to a quaternion?

Right now my assumption is

glm::quat a = glm::quat_cast(mat);



Can anyone please shed some light on weather or not i'm doing this right?

Assimp meshes & animation

15 February 2014 - 11:19 PM

Hi guys,


I'm working on an assimp model loader. I ran into a pretty big problem, i have no idea how to associate a mesh with an animation. Right now i always assume mesh 1 belongs to animation 1, etc...


Is there any way to tell what animation belongs to what mesh?

frustum generation Question

31 January 2014 - 02:36 PM

I'm trying to auto generate a camera frustum for shadow mapping. I have 4 points in world space (The corners of the viewing cameras frustum). I want to build an orthographic frustum that encompases these 4 points as tight as possible, but is aligned with my directional lights direction vector.


I have no idea what to google for, does anyone know what this is called?