Animated Water to a Sphere

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
Jono
Posts: 4
Joined: Wed Dec 01, 2010 11:02 pm
Location: SOUTH AFRICA

Animated Water to a Sphere

Post by Jono »

Im also new to irrlicht and c++ but am getting the hang of it quickly

just wandering

Ive created a sphere node and have animated water in an animated mesh

just want to know if i can apply the animated mech to the sphere

"scene::ISceneNode * node = smgr->addSphereSceneNode();
if (node)
{
node->setScale(core::vector3df(20.f,20.f,20.f));
node->setPosition(core::vector3df(0,0,30));
node->setMaterialTexture(0, driver->getTexture("../../media/water.jpg"));
node->setMaterialFlag(video::EMF_LIGHTING,false);
//Create mesh to add water effect to

//camera->setPosition(core::vector3df(140.f, 120.f, 5.f));
IAnimatedMesh* plane2 = smgr->addHillPlaneMesh("Plane2", // Name of mesh
core::dimension2d<f32>(20,20), // Size of a tile of the mesh. (10.0f, 10.0f) would be a good value to start, for example.
core::dimension2d<u32>(80,80), 0, 0, // Specifies how much tiles there will be. If you specifiy for example that a tile has the size (10.0f, 10.0f) and the tileCount is (10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f.
core::dimension2d<f32>(10,10), //material
core::dimension2d<f32>(1,1)); //countHills

// smgr->setPosition(core::vector3df(0,0,30));

//mesh, waveheight = 0.5f, wave speed = 350.0f, wave length = 80.0f

ISceneNode* sea2 = smgr->addWaterSurfaceSceneNode(plane2->getMesh(0), 50.0f, 390.0f, 100.0f);
sea2->setPosition(core::vector3df(230,230,30));
sea2->setMaterialTexture(0, driver->getTexture("../../media/water.png"));
sea2->setMaterialFlag(EMF_LIGHTING, false);

sea2->setMaterialType(video::EMT_REFLECTION_2_LAYER);
sea2->setMaterialType(video::EMT_TRANSPARENT_REFLECTION_2_LAYER);
//
}
"
Looking for any help :oops:
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

First off all, put your problem in appropriate forum (Beginners help), and also put your code in code tags for the sake of ones reading your code, and trying to help.

I can't be helpful at this topic tough, but I think you can find many samples in the forums, or wiki I think.

Good luck :wink:
Working on game: Marrbles (Currently stopped).
Jono
Posts: 4
Joined: Wed Dec 01, 2010 11:02 pm
Location: SOUTH AFRICA

Post by Jono »

Thanks Brue :arrow: Ill Look Around
Post Reply