Drawing an icosahedron sphere with drawVertexPrimitiveList?
Posted: Wed Jan 15, 2014 6:07 am
I have two files from this page http://people.sc.fsu.edu/~jburkardt%20/ ... _grid.html where one of the files is called
sphere_grid_icos1_f7_triangulation.txt and the other is sphere_grid_icos1_f7.xyz.
The first file is the triangulation part which is supposed to be used for setting up the indices in an array. I setup an array called and
I'm assuming that I can just read the file from any column directly into the array for all 980 rows???
The second file is the points of each node which I store inside an array call and I load all of those using a simple loop:
where the float_points array contains all the positions.
To make a long story short I then try to use the call,
I'm just not sure what column to read for the indices and how many points I'm supposed to read in but I'm pretty sure the points array for the node positions is correct.
Any ideas?
Please,
Thanks!
EDIT: I added the files for the sphere indices and node points to pastebin for future reference in case that other site vanishes.
pastebin link for sphere_grid_icos1_f7.xyz -> http://pastebin.com/H9rn8CgX
and for sphere_grid_icos1_f7_triangles.txt -> http://pastebin.com/DP139wuT
sphere_grid_icos1_f7_triangulation.txt and the other is sphere_grid_icos1_f7.xyz.
The first file is the triangulation part which is supposed to be used for setting up the indices in an array. I setup an array called
Code: Select all
irr::u16 tri_i[980];
I'm assuming that I can just read the file from any column directly into the array for all 980 rows???
The second file is the points of each node which I store inside an array call
Code: Select all
irr::video::S3DVertex tri_v[492];
Code: Select all
for(int col = 0; col < 492; col++)
{
int x = this->floats_points[0][col];
int y = this->floats_points[1][col];
int z = this->floats_points[2][col];
tri_v[col].Pos.set(x, y, z);
}
To make a long story short I then try to use the call,
Code: Select all
driver->drawVertexPrimitiveList(tri_v, 980, tri_i, 492, irr::video::EVT_STANDARD, irr::scene::EPT_QUADS, irr::video::EIT_16BIT);
Any ideas?
Please,
Thanks!
EDIT: I added the files for the sphere indices and node points to pastebin for future reference in case that other site vanishes.
pastebin link for sphere_grid_icos1_f7.xyz -> http://pastebin.com/H9rn8CgX
and for sphere_grid_icos1_f7_triangles.txt -> http://pastebin.com/DP139wuT