About Store Forum Documentation Contact
Donations:
140$/mo



Post Reply 
Water
Author Message
Soul Offline
Member

Post: #1
Water
Hi i Read the Tutorials fro mThe Esenthel Engine but i dont understand to add water in my level.

How i can add Water in My Level ??

I cant found a Header for the Water i foudn only the .cpp file.

Hope soemone can me help


-Soul-
10-24-2009 11:46 AM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #2
RE: Water
(10-24-2009 11:46 AM)Soul Wrote:  Hi i Read the Tutorials fro mThe Esenthel Engine but i dont understand to add water in my level.

How i can add Water in My Level ??

I cant found a Header for the Water i foudn only the .cpp file.

Hope soemone can me help


-Soul-

You Init it like this:

Code:
Water.images(*Images("Mtrl/Gfx/Water/0.gfx"),*Images("Mtrl/Gfx/Water/0.n.gfx"),Images("Mtrl/Gfx/Reflection/reflection.gfx")); // set water from textures
Water.wave_scale = 0.8;
Water.draw = true;

And update it after:

Code:
Water.update(Vec2(0.01,0.01));
10-24-2009 12:12 PM
Find all posts by this user Quote this message in a reply
Soul Offline
Member

Post: #3
RE: Water
Where i must this Write ?

-Soul-
10-24-2009 12:28 PM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #4
RE: Water
(10-24-2009 12:28 PM)Soul Wrote:  Where i must this Write ?

-Soul-

EsenthelEngineSDK\Tutorials\Source\Advanced\2 - Animation, Physics, Rendering\Rendering\Water.

Read it.
10-24-2009 12:52 PM
Find all posts by this user Quote this message in a reply
Soul Offline
Member

Post: #5
RE: Water
I said i read it i read it 10 times.

tehre stand nothing to add water -.-

so?

-Soul-
10-24-2009 12:58 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #6
RE: Water
Nothing there to add water? Xhizors just showed you the entire codeblock which is in that turorial.

You should know some C++ before you start of course. smile
10-24-2009 01:30 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #7
RE: Water
you put this in your Init() function:
Code:
Water.images(*Images("Mtrl/Gfx/Water/0.gfx"),*Images("Mtrl/Gfx/Water/0.n.gfx"),Images("Mtrl/Gfx/Reflection/reflection.gfx")); // set water from textures
Water.wave_scale = 0.8;
Water.draw = true;

and this in your Main() function:
Code:
Water.update(Vec2(0.01,0.01));

this will add water to the whole scene.


EDIT:
and of cause using
Images("Mtrl/Gfx/Water/0.gfx")
is assuming that you have your IO path set to the data folder of your project... if not, you have to use the full path for the files...

hope it helped
(This post was last modified: 10-24-2009 01:38 PM by craksy.)
10-24-2009 01:36 PM
Find all posts by this user Quote this message in a reply
Soul Offline
Member

Post: #8
RE: Water
In wich init function ?

and in wich data a Example?
10-24-2009 01:41 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #9
RE: Water
if you created a new project, your Main.cpp (or whatever it's called) should have this:

Code:
bool Init()
{
     ...
}
that the Init() function.

and your project folder should also include a Data folder containing all the resources for the game... you should set your IO path to this folder.
10-24-2009 02:03 PM
Find all posts by this user Quote this message in a reply
Soul Offline
Member

Post: #10
RE: Water
ok thanks ^^
1 question what means IO

-soul-
10-24-2009 02:10 PM
Find all posts by this user Quote this message in a reply
craksy Offline
Member

Post: #11
RE: Water
Input/output... all file adresses start from your I/O path
say your IO path is "C:\documents and setting\Name\documents\project\data\"
when accessing a file instead of having:
"C:\documents and setting\Name\documents\project\data\gfx\water\0.gfx"
you could simply use:
"gfx\water\0.gfx"
10-24-2009 02:27 PM
Find all posts by this user Quote this message in a reply
Chosker Offline
Member

Post: #12
RE: Water
I know the question is already answered but anyway
based on the original question it seems the guy wanted to add water via the World Editor. Not being able to do this seems weird but doable if you only have water as a sea (ie. all at the same level, infinite area).
then if you want to have water somewhere else like a small lake or a fountain (ie. different height level, a finite enclosed area) I guess that's what WaterArea is for (though it doesn't support mirrored reflections), but I haven't found any tutorial, info or even a thread on the forum about it.
So at least for smaller water areas (if that's what WaterAreas are for) it would be nice to be able to add them via the World Editor
10-24-2009 04:14 PM
Find all posts by this user Quote this message in a reply
Post Reply