Page 1 of 1

Is it possible to have the water node on terrain?

Posted: Sun Dec 10, 2006 9:58 pm
by pinkman
scene::ISceneNode* node = 0;
node = smgr->addWaterSurfaceSceneNode(terrainNode->getMesh, 3.0f, 300.0f, 30.0f);
node->setPosition(core::vector3df(0,7,0));
node->setMaterialTexture(1, driver->getTexture("media/water.jpg"));
node->setMaterialType(video::EMT_REFLECTION_2_LAYER);

I am using this, and I just get this error..

120 C:\Documents and Settings\Administrator\Desktop\SquareSoft\main.cpp no matching function for call to `irr::scene::ISceneManager::addWaterSurfaceSceneNode(<unknown type>, float, float, float)'

whats the problem? x_x I have tried befor also, couldnt get it then.

Posted: Sun Dec 10, 2006 10:39 pm
by JP
Try putting braces after terrainNode->getMesh ;)

Posted: Sun Dec 10, 2006 10:44 pm
by pinkman
tried that, didnt work..

[edit]
uhm okay, well i got it to compile.. :)

Okay, well it compiles but, I dont see the water anywhere.. x_x I changed posistion scale, its not showing up.

Posted: Sun Dec 10, 2006 10:48 pm
by Saturn
Oh, please. Read again, do again. Like JP said. It is obvious. (again)

Posted: Sun Dec 10, 2006 10:56 pm
by pinkman
It compiles.. thats not an issue anymore, I just cannot seem to get the water to even show now. x_X

Posted: Mon Dec 11, 2006 3:29 am
by trooper
Hey pinkman.

Just looking at my code and the examples.

I see you have:

Code: Select all

node->setMaterialTexture(1,  .......
This is the second layer

Try adding something for:

Code: Select all

node->setMaterialTexture(0, .......
Also on my terrain demo, even with a very smooth terrain, I could hardly get water below (Y=10)
So try changing:

Code: Select all

node->setPosition(core::vector3df(0,20,0)); 
or something higher until you can see it.