ezza ezze
ezza
About Me
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Create a Sphere Geometry in VEX July 29, 2016, 5:23 p.m.
Im gonna look for it!!
due to my lack of english, I think I couldnt proper look on google,
thks so much for the answer,
awesome community!
due to my lack of english, I think I couldnt proper look on google,
thks so much for the answer,
awesome community!
Create a Sphere Geometry in VEX July 29, 2016, 1:56 p.m.
hello, I'm trying create geometry from a group of point,polar coordinates, from an array.
It gives a meshed sphere but with hole, and overlapping points.
I guess I shd use some condition but I'm not really sure how..
int total =40;
int prim;
float r = 200.0;
float lon = 2*($PI); //-pi,pi
float lat = 2*($PI);//-pi/2, pi/2
float step_lon = lon/total; //angle sur la longitude
float step_lat = lat/total;//angle sur la latitude
int globe = {0,0,0};
vector pos ={0,0,0};
for (int i=0 ; i<total+1; i++){
for (int j=0; j< total+2; j++){
//polar to cartesian
float x = r * sin(lon) * cos(lat);
float y = r * sin(lon) * sin(lat);
float z = r * cos(lon);
//vector pos
pos = set(x,y,z);
//feed array, create points sphere
globe=addpoint(geoself(), pos);
int v1 = globe;
int v2 = globe;
int v3 = globe;
prim = addprim(geoself(), “poly”);
addvertex(geoself(), prim, v1);
addvertex(geoself(), prim, v2);
addvertex(geoself(), prim, v3);
//setpointattrib(geoself(), “lat”, v1, j, “set”);
// setpointattrib(geoself(), “lat”, v2, j+1, “set”);
//setpointattrib(geoself(), “lat”, v3, j+2, “set”);
lat += step_lat;
}
lon +=step_lon;
}
u will find in my hip file, vex code for creating a sphere, then a mesh.
thks
It gives a meshed sphere but with hole, and overlapping points.
I guess I shd use some condition but I'm not really sure how..
int total =40;
int prim;
float r = 200.0;
float lon = 2*($PI); //-pi,pi
float lat = 2*($PI);//-pi/2, pi/2
float step_lon = lon/total; //angle sur la longitude
float step_lat = lat/total;//angle sur la latitude
int globe = {0,0,0};
vector pos ={0,0,0};
for (int i=0 ; i<total+1; i++){
for (int j=0; j< total+2; j++){
//polar to cartesian
float x = r * sin(lon) * cos(lat);
float y = r * sin(lon) * sin(lat);
float z = r * cos(lon);
//vector pos
pos = set(x,y,z);
//feed array, create points sphere
globe=addpoint(geoself(), pos);
int v1 = globe;
int v2 = globe;
int v3 = globe;
prim = addprim(geoself(), “poly”);
addvertex(geoself(), prim, v1);
addvertex(geoself(), prim, v2);
addvertex(geoself(), prim, v3);
//setpointattrib(geoself(), “lat”, v1, j, “set”);
// setpointattrib(geoself(), “lat”, v2, j+1, “set”);
//setpointattrib(geoself(), “lat”, v3, j+2, “set”);
lat += step_lat;
}
lon +=step_lon;
}
u will find in my hip file, vex code for creating a sphere, then a mesh.
thks