Skip to content

Instantly share code, notes, and snippets.

View ryosuzuki's full-sized avatar

Ryo Suzuki ryosuzuki

View GitHub Profile
#include "mesh.h"
void Mesh::set(const Eigen::MatrixXf &V_, const Eigen::MatrixXi &F_) {
V = V_;
F = F_;
computeNormals();
computeAdjacencyMatrix();
computeEdgeLength();
#include "opengl.h"
void OpenGL::initBuffers() {
glGenVertexArrays(1, &vaoMesh);
glBindVertexArray(vaoMesh);
glGenBuffers(1, &vboVertices);
glGenBuffers(1, &vboNormals);
glGenBuffers(1, &vboUVs);
glGenBuffers(1, &vboFaces);
@ryosuzuki
ryosuzuki / ARAP.md
Last active February 29, 2016 07:53

As Rigid As Possible

C++ implmentation

@ryosuzuki
ryosuzuki / Node-ffi-array.md
Last active March 3, 2024 21:00
Node-ffi example: Passing and receiving array object between Node.js and C++ binding

Node-ffi with IntArray

Passing and receiving array object between Node.js and C++ binding

$ g++ -dynamiclib -o mylib.dylib main.cpp
$ node index.js
[matrix size: 100x100; n_nonzero: 4; density: 0.04%]

 (1, 1) 2.0000
@ryosuzuki
ryosuzuki / Node-ffi.md
Last active February 29, 2016 07:52
Hello world with node-ffi

Hello world with node-ffi

Use C++ dynamic library from Node.js with node-ffi

$ g++ -dynamiclib -o libhello.dylib hello.cpp
$ ls 
libhello.dylib   hello.cpp   hello.js
$ node hello.js
hello world
@ryosuzuki
ryosuzuki / index.xml
Created October 16, 2015 22:03
craftml
<craft>
<info>
<title>Untitled</title>
</info>
<param name="h" type="int" default="20"
label="height of the cylinder"/>
<param name="n" type="int" default="3"
label="number of spheres"/>
@ryosuzuki
ryosuzuki / index.xml
Created October 16, 2015 22:03
craftml
<craft>
<info>
<title>Untitled</title>
</info>
<param name="h" type="int" default="20"
label="height of the cylinder"/>
<param name="n" type="int" default="3"
label="number of spheres"/>
@ryosuzuki
ryosuzuki / index.xml
Created October 16, 2015 22:02
craftml
<craft>
<info>
<title>Gear</title>
</info>
<craft name="sun-layout" module="sun-layout"/>
<param name="diameter" default="10" type="int"/>
<param name="teeth" default="10" type="int"/>
<param name="center_diameter" default="1.5" type="int"/>
@ryosuzuki
ryosuzuki / index.xml
Last active September 2, 2015 23:39
craftml
<craft name="chair">
<param name="length" type="int" default="15"/>
<param name="legHeight" type="int" default="14"/>
<stack l="alignX(0%)" color="peru">
<!-- Back -->
<stack spacing="-13">
<stack spacing="-4">
<cylinder height="1" radius="6"
t="rotateY(90)