2D Transforms

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

2D Transforms

Postby Arclamp » Sun Aug 06, 2017 6:26 pm

There is a list of vertices defining a shape.

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

cpp 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);
Posts: 48
Joined: Thu Oct 10, 2013 7:45 pm

Re: 2D Transforms

Postby CuteAlien » Sun Aug 06, 2017 11:28 pm

For 2D mode the only way is to tranform the vertices individually. The transformation matrices used in 2D are fixed otherwise.
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
Posts: 8441
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: 2D Transforms

Postby kornwaretm » Sat Aug 12, 2017 12:34 pm

i have a 2d matrix class here http://irrlicht.sourceforge.net/forum/viewtopic.php?f=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.
Competition winner
Posts: 188
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia

Re: 2D Transforms

Postby Arclamp » Mon Aug 14, 2017 10:26 pm

I'll have a look see soon... Thanks
Posts: 48
Joined: Thu Oct 10, 2013 7:45 pm

Return to Beginners Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest