I have some quadrilateral (4 points) facets that I want to force to be planar - how can I calculate the closest planar face of the non-planar geometry? What algorithm should I look for?
I'd like to create grid of shapes - ie. tesselation on the plane of some basic geometric tiles such triangles, quads, and hexagons.
I thought it would be nice to have a unique Class Shape to handle different basic shapes and then replicate them by translations. But I am not sure how to organize data...Let's say I have 3 basic shapes should I have 3 constructor that build the actual shape or should I have additional function for that?
Then the same when I want to create the grid with the basic shape. Another issue is that If, lets say I use pvector to locate points for basic shape, then I dont want to have duplicate points on shape that are next to each other - any idea how to avoid this?
It would great if someone has a very basic sample I can look at to have some ideas how can I start building it. Suggestions?
I am trying to use beginShape within my PApplet but in eclipse I can specify the mode as integer only - so my question is the Processing (QUADS) mode what integer is ? How can I sort this out?
I am porting a project to Eclipse because I want to learn more an be more flexible with other available java libraries and debugging etc..
I understood that all processing graphics functions when used in other classes need to refer to the PApplet...what about other data types such as PVector? How do I access them from other classes in Eclipse?
I know my question might sound odd but I am learning...;-)
I am doing a small project which involves creating different layers of hexagon grid with particles and springs.
I managed to create different layers with a 3D array (but not sure this is efficient - so if u know a better way tell me) now I want to build planar faces between spring on one layer and another in the top one.
so now to draw lines btw springs I call the .getOneEnd() and getOtherEnd() methods of Traer library . This gives me two points - I need 4 for planar faces. Any idea about how I could organize the code?
import processing.opengl.*;
import traer.physics.*;
import peasy.*;
PeasyCam cam;
ParticleSystem pSys;
ArrayList particles = new ArrayList();
ArrayList springs = new ArrayList();
//GLobal Variables
int Scale = 3;
//Grid extents
int max_x = 20;
int max_y = 15;
//Top most level
int max_z =20;
// numebrs of layers
int numL = max_z/4;
Particle [][][]grid = new Particle [max_x][max_y][max_z];
float K = .2;//.4
float D = 0.2;
//spring rest length
float rest =.8; //.8
void setup() {
size(600, 600, OPENGL);
smooth();
fill(0);
cam = new PeasyCam(this,width/8,0,0,250);
cam.setMinimumDistance(250);
cam.setMaximumDistance(800);
pSys = new ParticleSystem(0, 0.25);
//Function to add particle and connect them with springs according to hex topology
I am trying to move an object with translate but at the same time I want to show the previous position of such object (kind of tracking history). I usually do this by deleting the background but in this case if I do so then the 3D navigation o crazy for obvious reasons. Do you know another way I can still show the prev position of an object using a background at the same time?