PShape Array Parameters

edited March 2016 in Library Questions

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

Tagged:

Answers

  • I'm also doing something similar (with beginshape) to re-parse an OBJ to remove the child-shape per face thing, so I'm interested in any answer to your issue. Subscribing to thread.

Sign In or Register to comment.