Terrain dependent friction
Posted: Fri Jun 16, 2006 10:52 pm
For my university project we're creating a bike simulator which is a cross between an arcade game and an exercise bike where you can steer through a 3d course but have to pedal to provide your speed along the way (uphill being harder and downhill freewheeling etc).
Having figured out the whole blender-Irrlicht .x export problems it's all going well except for one feature:
Terrain dependent friction.
Instead of using a TerrainSceneNode we're creating a mesh of a terrain in Blender and texturing different uv faces differently (ie road and grass). We're using a triangle selector to determine the angle of the ground the bike is on and hence the force (and acceleration) this creates. I was then hoping to use "GetMaterial" to determine the texture of the triangle and hence use it to alter our value for friction if it's on road or grass but it seems I misunderstood the function completely.
Having searched the forums I found a post from december:
(http://irrlicht.sourceforge.net/phpBB2/ ... ap+texture)
This asks about getting the texture of a whole terrainSceneNode but no answer was found and our problem is even more specific in needing to know which texture covers which triangle.
I can use
slope_node->getMaterial(1).Texture1 = driver->getTexture("../media/test2.bmp");
slope_node->getMaterial(2).Texture1 = driver->getTexture("../media/test3.bmp");
to change all the two individual textures so was wondering if it's in any way posible to determine which ones apply to which triangles? filenames aren't a problem, all we need is simply some kind of flag (number etc) to tell the difference between the two?
Thanks in advance,
Hixxy.
Having figured out the whole blender-Irrlicht .x export problems it's all going well except for one feature:
Terrain dependent friction.
Instead of using a TerrainSceneNode we're creating a mesh of a terrain in Blender and texturing different uv faces differently (ie road and grass). We're using a triangle selector to determine the angle of the ground the bike is on and hence the force (and acceleration) this creates. I was then hoping to use "GetMaterial" to determine the texture of the triangle and hence use it to alter our value for friction if it's on road or grass but it seems I misunderstood the function completely.
Having searched the forums I found a post from december:
(http://irrlicht.sourceforge.net/phpBB2/ ... ap+texture)
This asks about getting the texture of a whole terrainSceneNode but no answer was found and our problem is even more specific in needing to know which texture covers which triangle.
I can use
slope_node->getMaterial(1).Texture1 = driver->getTexture("../media/test2.bmp");
slope_node->getMaterial(2).Texture1 = driver->getTexture("../media/test3.bmp");
to change all the two individual textures so was wondering if it's in any way posible to determine which ones apply to which triangles? filenames aren't a problem, all we need is simply some kind of flag (number etc) to tell the difference between the two?
Thanks in advance,
Hixxy.