Is it possible to have the water node on terrain?

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
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Is it possible to have the water node on terrain?

Post 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.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Try putting braces after terrainNode->getMesh ;)
Image Image Image
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Post 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.
Last edited by pinkman on Sun Dec 10, 2006 10:55 pm, edited 1 time in total.
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Oh, please. Read again, do again. Like JP said. It is obvious. (again)
pinkman
Posts: 25
Joined: Sun Dec 10, 2006 3:04 am

Post by pinkman »

It compiles.. thats not an issue anymore, I just cannot seem to get the water to even show now. x_X
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post 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.
You scratch my back, I'll scratch yours.
Post Reply