http://lightofdawn.org/wiki/wiki.cgi/-wiki/NewAppsOnOldGlibc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ImGuiHandler.hpp> | |
#include <imgui/imgui.h> | |
#include <iostream> | |
using namespace sf; | |
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure) | |
// If text or lines are blurry when integrating ImGui in your engine: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::ofstream aFile ( "Mesh.obj" ); | |
for (int i = 0; i < aMesh->numVertices(); ++i) { | |
aFile << "v " << aMesh->vertices()[i].x() << " " | |
<< aMesh->vertices()[i].y() << " " | |
<< aMesh->vertices()[i].z() << std::endl; | |
} | |
for (int i = 0; i < aMesh->numVertices(); ++i) { | |
aFile << "vn " << aMesh->normals()[i].x() << " " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void BRepMesh_RestoreOrientationTool::WriteMesh (const std::string& theFileName) | |
{ | |
// write obj file | |
std::ofstream myfile; | |
myfile.open (theFileName); | |
const Handle(BRepMesh_TriangulatedPatch)& aPatch = myPatches.back(); | |
for (int i = 0; i < aPatch->Vertices.size(); ++i) { | |
BVH_Vec3d aVert = aPatch->Vertices[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE); | |
const int aDefaultColor = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED; | |
auto printTable = [&](const std::set<Standard_Integer>& theRemSet) { | |
return; // disabled | |
std::cout << setw (3) << " "; | |
for (int j = 0; j < aTableSize; ++j) { | |
std::cout << setw (6) << j; | |
} |
http://www.reedbeta.com/blog/2013/01/12/quick-and-easy-gpu-random-numbers-in-d3d11/
https://github.com/openglsuperbible/sb6code/blob/master/bin/media/shaders/ssao/ssao.fs.glsl http://math.stackexchange.com/questions/337782/pseudo-random-number-generation-on-the-gpu
http://www.trentreed.net/blog/screen-space-ambient-occlusion/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef double real; | |
typedef Eigen::Vector2d vec2; | |
typedef Eigen::Vector2i int2; | |
typedef Eigen::Vector4i int4; | |
vec2 mix (vec2 a, vec2 b, real c) { | |
return (a + b) * c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Spherical linear interpolation between unit quaternions q1 and q2 with interpolation parameter t. | |
Quaternion slerp(Quaternion q1, Quaternion q2, float t) | |
{ | |
float w1, x1, y1, z1, w2, x2, y2, z2, w3, x3, y3, z3; | |
Quaternion q2New; | |
float theta, mult1, mult2; | |
w1 = q1.getW(); x1 = q1.getX(); y1 = q1.getY(); z1 = q1.getZ(); | |
w2 = q2.getW(); x2 = q2.getX(); y2 = q2.getY(); z2 = q2.getZ(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// NOTE: You should always edit options in user file, not this file. | |
// Print debug message | |
"debug": false, | |
// Auto format on file save | |
"autoformat_on_save": false, | |
// The mapping key is `syntax name`, and the value is `formatting mode`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ======================================================================= | |
// function : PrintPretty | |
// purpose : | |
// ======================================================================= | |
void RayTraceGPU_Node::PrintPretty (std::string thePrefix, bool isLeft, int theLevel) const | |
{ | |
if (IsLeaf()) | |
{ | |
thePrefix.erase(thePrefix.size() - 2, 2); | |
thePrefix += isLeft ? "|-" : "\xC0-"; |