Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

PShape Array Parameters

$
0
0

Hello,

Is it possible to create a PShape VBO using float arrays?

I'm using the newmesh package from toxiclibs, when the compile method of an IndexedTriangleMesh is called it returns a Hashmap that looks like this:

vertices [10.0, 17.320509, 0.0, 20.0, 0.0, 0.0, 0.0, 0.0, 0.0, -10.0, 17.320509, 0.0, 10.0, 17.320509, 0.0, 0.0, 0.0, 0.0, -20.0, 2.4492936E-15, 0.0, -10.0, 17.320509, 0.0, 0.0, 0.0, 0.0, -10.0, -17.320509, 0.0, -20.0, 2.4492936E-15, 0.0, 0.0, 0.0, 0.0, 10.0, -17.320509, 0.0, -10.0, -17.320509, 0.0, 0.0, 0.0, 0.0, 20.0, 0.0, 0.0, 10.0, -17.320509, 0.0, 0.0, 0.0, 0.0] vnormals [0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0] fnormals [0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0]

I know i could use beginShape(); normal(...); vertex(...);...endShape(); but was wondering if there was a better way of doing this?

Thanks


Viewing all articles
Browse latest Browse all 2896

Trending Articles