vegetation generator...
Posted: Wed Aug 04, 2004 8:21 pm
heh, i know theres not one, i was trying to make one... but i feel so confused, im not trying to do it as a class or anything yet, cause that makes my brain want to explode.... ive only been coding like 8 months
anyyyways, heres the code i used, it seems to compile right, but it crashes when i run the binary...
int x=1,z=1;
f32 iX=0.0f,iZ=0.0f,iY=0.0f,y=0.0f;
IAnimatedMeshSceneNode* vegnode=0;
IAnimatedMesh* tree = 0;
tree = smgr->getmesh("tree.3ds");
while (x<10)
{
x++;
while (z<10)
{
z++ //parent is parent of terrainscenenode
//you cant call getPosition on terrainscenenode
core::vector3df<f32>(iX,iY,iZ) = parent->getPosition( );
iZ++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
iX++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
i know that'll only produce trees in a line at the moment, but im too tired to think about that, i just wanna know why its dieing... lol
just dont laugh at my newbie coding, i did this at 5 am....
well, thanks in advance
ps... someone tell niko, that girlfriends are bad ideas, that just means less time for him to work on irrlicht... bad niko... bad
anyyyways, heres the code i used, it seems to compile right, but it crashes when i run the binary...
int x=1,z=1;
f32 iX=0.0f,iZ=0.0f,iY=0.0f,y=0.0f;
IAnimatedMeshSceneNode* vegnode=0;
IAnimatedMesh* tree = 0;
tree = smgr->getmesh("tree.3ds");
while (x<10)
{
x++;
while (z<10)
{
z++ //parent is parent of terrainscenenode
//you cant call getPosition on terrainscenenode
core::vector3df<f32>(iX,iY,iZ) = parent->getPosition( );
iZ++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
iX++;
terrain->getHeight(core::vector2d<f32>(iX,iZ),y);
vegnode = smgr->addAnimatedMeshSceneNode(tree,0,-1,
core::vector3df(iX,y,iZ);
}
i know that'll only produce trees in a line at the moment, but im too tired to think about that, i just wanna know why its dieing... lol
just dont laugh at my newbie coding, i did this at 5 am....
well, thanks in advance
ps... someone tell niko, that girlfriends are bad ideas, that just means less time for him to work on irrlicht... bad niko... bad