karansher / computer-graphics-meshes

Computer Graphics Assignment about Meshes
0 stars 0 forks source link

Eigen::Index = long int]: Assertion `row >= 0 && row < rows() && col >= 0 && col < cols()' failed. #9

Open Sean7ee opened 2 years ago

Sean7ee commented 2 years ago

I'm getting the error above when I try to resize the F matrix. I don't know why this might be happening... help!

` V.resize(8, 3); V.row(0) = Eigen::RowVector3d(0, 0, 0); V.row(1) = Eigen::RowVector3d(1, 0, 0); V.row(2) = Eigen::RowVector3d(1, 1, 0); V.row(3) = Eigen::RowVector3d(0, 1, 0); V.row(4) = Eigen::RowVector3d(0, 0, 1); V.row(5) = Eigen::RowVector3d(1, 0, 1); V.row(6) = Eigen::RowVector3d(1, 1, 1); V.row(7) = Eigen::RowVector3d(0, 1, 1);

F.resize(6, 4); ` above is all I have right now for cube.cpp and yet I am getting the error seen in title. I don't understand why V.resize is fine, but F.resize is giving me this error when I try ./obj

talicopanda commented 2 years ago

Are you sure the error is with resizing F? I have something very similar, except that I left the row assignment to Eigen by just doing:

V << 0, 0, 0, 1,0,0, 1,1,0, ... 0,1,1;

Sean7ee commented 2 years ago

Google searches tell me that this is a compile time error I originally had row assignment like that as well I was just trying different stuff to let the compiler know that i was aware of the size of the matrix. But thanks for your comment!