Skip to content

Instantly share code, notes, and snippets.

View marty958's full-sized avatar
👩‍🔬
Researcher

Misaki Sakashita marty958

👩‍🔬
Researcher
View GitHub Profile
@marty958
marty958 / SaveOpenGLWidowWithOpenCV.cpp
Created June 20, 2020 05:00
Save a OpenGL widow image with OpenCV
#include <iostream>
#include <OpenGL/OpenGL.h>
#include <GLUT/GLUT.h>
#include "opencv2/opencv.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
const int WindowSize = 600;
void display(void){
@marty958
marty958 / main.cpp
Last active December 20, 2019 02:57
Use Marching Cubes
#include "CIsoSurface.h"
using namespace std;
int main() {
const int pnum = 2;
float field[pnum][pnum][pnum] = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
CIsoSurface<float> *ciso = new CIsoSurface<float>();
ciso->GenerateSurface(&field[0][0][0], 0.5, pnum - 1, pnum - 1, pnum - 1, 1.0, 1.0, 1.0);
return 0;
}
template <class T>
void CIsoSurface<T>::PrintVTK(int step, string _foldername) {
if(!IsSurfaceValid()) {
cout << "Isosurface is not valid!" << endl;
exit(1);
}
ostringstream oss_step;
oss_step.setf(ios::right);
oss_step.fill('0');
oss_step.width(8);
@marty958
marty958 / dla.pde
Last active March 31, 2017 12:35
DLAprogram
ArrayList<Seed> seeds;
ArrayList<Particle> particles;
ArrayList<Integer> changes;
int i, j;
int count;
float dx;
float dy;
float dist;
float mindist;
int minnum;