Page 1 of 1

2D Transforms

Posted: Sun Aug 06, 2017 6:26 pm
by Arclamp
There is a list of vertices defining a shape.

How to transform, e.g. rotate, translate?

Code: Select all

 
    ...
    core::matrix4 mat = irr::core::IdentityMatrix;
    mat.setTranslation(vector3df(200, 200, 0));
    driver->setTransform(video::ETS_WORLD, mat);    //??        ETS_VIEW, ETS_WORLD, ETS_PROJECTION, 
    
    driver->draw2DVertexPrimitiveList(vertices, count, index, count-2, video::EVT_STANDARD, EPT_TRIANGLE_STRIP);
 

Re: 2D Transforms

Posted: Sun Aug 06, 2017 11:28 pm
by CuteAlien
For 2D mode the only way is to tranform the vertices individually. The transformation matrices used in 2D are fixed otherwise.

Re: 2D Transforms

Posted: Sat Aug 12, 2017 12:34 pm
by kornwaretm
i have a 2d matrix class here http://irrlicht.sourceforge.net/forum/v ... =9&t=51662 . you can use it if it suits your need. just copy the codes there, one for the matrix2d and the simpleobject class. there`s also example how to use it.

Re: 2D Transforms

Posted: Mon Aug 14, 2017 10:26 pm
by Arclamp
I'll have a look see soon... Thanks