Skip to content

Instantly share code, notes, and snippets.

View roymacdonald's full-sized avatar

Roy Macdonald roymacdonald

View GitHub Profile
@roymacdonald
roymacdonald / LODTest.html
Created July 8, 2015 22:27
Level of detail mesh max vertices test for three.js. just download file and run on browser. It will download the needed libs
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - materials - wireframe</title>
<meta charset="utf-8">
<style>
body {
background:#000;
color:#fff;
padding:0;
@roymacdonald
roymacdonald / main.cpp
Created July 8, 2015 22:08
Level of detail mesh max vertices test for openFrameworks. All the code is inside the main.cpp file
#include "ofMain.h"
class LODMeshInstanced{
public:
ofVboMesh tile;
ofShader* shader;
int levels, totalWidth, resolution, numTiles;
vector<ofVec3f>tilePositions;
vector<float>tileScale;
@roymacdonald
roymacdonald / gist:265654a165334aa7e498
Created July 8, 2015 21:24
Max vertices rendering test openFrameworks
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
ofVboMesh mesh;
int resolution;
int numVertices;
ofEasyCam cam;
//--------------------------------------------------------------
void setup(){
@roymacdonald
roymacdonald / gist:c6c83faea3a6ef7278e6
Created July 8, 2015 21:16
Max vertices rendering test three.js.
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - materials - wireframe</title>
<meta charset="utf-8">
<style>
body {
background:#000;
color:#fff;
padding:0;
#include "ofMain.h"
class ofApp : public ofBaseApp{
public:
ofRectangle viewport;
bool bUseOrtho, bUseCamera;
ofCamera cam;
//--------------------------------------------------------------