Vectors
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Code: Select all
#define irrUnits q3UnitsOkey ill try that, can you take look at my 2nd thread http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=40332 ?
-
randomMesh
- Posts: 1186
- Joined: Fri Dec 29, 2006 12:04 am
Get a list of all nodes in your scene and explicitly scale them with this function
This example would scale the node to be exact 1.8 units in height.
What kind of units? Well, could be meters, yards, light-years. You decide.
The important thing is, that you scale objects relative to others.
Code: Select all
void setNodeHeight(irr::scene::ISceneNode* const node, const irr::f32 requiredHeight)
{
const irr::core::aabbox3df& nodeBox = node->getBoundingBox();
const irr::f32 nodeHeight = nodeBox.getExtent().Y;
const irr::f32 nodeScale = requiredHeight/nodeHeight;
// printf("Required height: %f\n", requiredHeight);
// printf("Node height: %f\n", nodeHeight);
// printf("Scale factor: %f\n", nodeScale);
node->setScale(irr::core::vector3df(nodeScale, nodeScale, nodeScale));
node->updateAbsolutePosition();
}
Code: Select all
irr::scene::IMeshSceneNode* sydney = smgr->addMeshSceneNode(sydneyMesh->getMesh(0));
const irr::f32 SYDNEY_REQUIRED_HEIGHT = 1.8f; //units
setNodeHeight(sydney, SYDNEY_REQUIRED_HEIGHT);
What kind of units? Well, could be meters, yards, light-years. You decide.
The important thing is, that you scale objects relative to others.
"Whoops..."