I have to set the primitives to widthincells because when i set it to 1 i only draw from point 1 to point 2.CuteAlien wrote:Could be the number of primitives should be 1 (I think that's the 4th parameter). I mean it's just one LINE_STRIP per loop with the length of widthInCells/heightInCells, right? Though I'm not certain why it works at all then or how it interprets any number > 1 for line_strips. Should probably try to draw widthInCells times a line_strip of widthInCells length, but why it doesn't crash if tje vertex given only contains 1 ... not sure. If you used a single array instead you probably wouldn't even need a loop there, but could do something like:Not working in your case as your memory is not continuos. But if it where this would draw heightInCells times a linestrip with widthInCells vertices.Code: Select all
driver->drawVertexPrimitiveList(&verticesVertical[0], widthInCells, &uIndicesVertical[0], heightInCells, EVT_STANDARD, EPT_LINE_STRIP);
The problem is when I use a single array the lines are all over the place because i have to draw every line seperatly to create the grid. When i have everything in one array this dont work.
But i can be wrong about it, the way i tried it it didnt work.
just tried it again with one array the way you mentioned it. And the lines flew all over the place^^
My current source of the class (formatting screwed up by pastebin >.<):
EDE_GridSceneNode.h: http://pastebin.com/xJCBYh2x
EDE_GridSceneNode.cpp: http://pastebin.com/euXMvipx