Page 1 of 1
How to set the length, height and width of a cube?
Posted: Sat Mar 05, 2011 10:21 am
by wsw1231
Code: Select all
cubeNode = smgr->addCubeSceneNode();
The cubeNode buttom has y-value 0 by default.
Now, what I want to do is set the height to a certain value, say 100, then the cube should be of height 100 with its bottom y-value unchanged (i.e. still be 0)
How to solve that?
Posted: Sat Mar 05, 2011 10:32 am
by nespa
search for scale on x,y and z in the doc.
Posted: Sat Mar 05, 2011 10:39 am
by nespa
search for scale on x,y and z in the doc.
Code: Select all
cubeNode->setScale(core::vector3df(1,100,1));
and then:
Code: Select all
cubeNode-> setPosition(core::vector3df(0.0,50.0,0.0));
Posted: Sat Mar 05, 2011 1:28 pm
by serengeor
nespa don't double post, there's edit button for that.
Posted: Sat Mar 05, 2011 1:32 pm
by nespa
sorry !