How to set the length, height and width of a cube?

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
wsw1231
Posts: 148
Joined: Fri Oct 01, 2010 7:55 am

How to set the length, height and width of a cube?

Post 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?
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

search for scale on x,y and z in the doc.
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post 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));

Last edited by nespa on Sat Mar 05, 2011 1:34 pm, edited 1 time in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

nespa don't double post, there's edit button for that.
Working on game: Marrbles (Currently stopped).
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

sorry !
Post Reply