Processing Forum

Loading...

Move this topic

// Create an array to store vectors

PVector[] vectors = new PVector[3];

// Create a vector for array position 0

vectors[0] = new PVector();

// Modify the PVector at position 0

vectors[0].x = 9;

vectors[0].y = 8;

vectors[0].z = 7;

PVector[] vectors = new PVector[3];

// Create a vector for array position 0

vectors[0] = new PVector();

// Modify the PVector at position 0

vectors[0].x = 9;

vectors[0].y = 8;

vectors[0].z = 7;

Leave a comment on quarks's reply

Just remember a
__PVector__ can be instantiated and have their
float fields x, y & z initialized at the same time:

final short NUM = 3; PVector[] vectors = new PVector[NUM]; vectors[0] = new PVector(9, 8, 7); println(vectors[0]);

And they all can be changed at once again w/ its method
**set()**:

vectors[0].set(-8., .5, 3e-3); println(vectors[0]);

Leave a comment on GoToLoop's reply

Change topic type

Link this topic

Provide the permalink of a topic that is related to this topic

Reply to matsmaster's question

**2**Replies**463**Views**0**Followers