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.
Post Reply
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

2D Transforms

Post 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);
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: 2D Transforms

Post by CuteAlien »

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.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Re: 2D Transforms

Post 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.
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: 2D Transforms

Post by Arclamp »

I'll have a look see soon... Thanks
Post Reply