Category : 3d

The following c++ code snippet show how to open a depth map from a file and transform it into a 3D point cloud: FILE* inFile; //read the file fopen_s(&inFile,"depth.txt", "rb"); fread(d, sizeof(UINT16), nVertices, inFile); fclose(inFile); for(int i=0 ; i < nVertices ; i++) { int r_i = i / (int)n_c; int c_i = i % ..

Read more

I have a vec3 min and vec3 max, accessing the individual components using [], like min[0] for x. Now I want to build a list of vec3’s, where every two elements represents a line. How can I loop over the min/max so the list contains the lines for all outer edges of the AABB (basically ..

Read more

I am trying to a place a plane at the corner of my canvas(my app is in C++). My approach was to invert the camera projection matrix and then multiply it with the w and translate it to top right. So it looks like – origin(0.0, 0.0, 0.0, 1.0f); projViewInverse = Camera.projViewMatrix().inverse(); projectionMatrix = Camera.projViewMatrix(); ..

Read more