in OGL, I would simply do:
glPushMatrix();
glTranslatef(0, 100, 0);
//draw blocks
glPopMatrix();
looking at CustomSceneNode, you dont seem to have any PushMatrix stuff.. So I assume each 'node' has a built in equivilent of PushMatrix()? I havent yet tried to build a CSN yet though, I'm just writing raw drawing code for now.
Currently my code does this in its render stage (between m_driver->start and end functions):
Code: Select all
irr::core::matrix4 pilePos; //pilePos.makeIdentity(); unneccesary
pilePos.setTranslation(irr::core::vector3df(0, 100, 0));
m_driver->setTransform(irr::video::TS_WORLD, pilePos);
for(int i=0; i<TS_PILEBLOB_H-10 ;i++) {
for(int j=0; j<TS_PILEBLOB_W-10 ;j++) {
m_driver->draw2DRectangle(obj->rows[i][j],
irr::core::rect<irr::s32>( 44*j, 44*i, 44 + 44*j, 44 + 44*i));
}
}
Should I be drawing my blocks as 3D Quads to try to take advantage of this? The reason I want to do this is because your origin is TopLeft, but my Tetris_BlockBlob code assumes an origin of BottomLeft. So my Tetris_RenderBlob code needs to translate to the bottom left and then rotate 180degs around the X-Axis so the Y-axis points upwards.
Any advice?