New Tiled Terrain Scene Node [works with Irr 1.5]
Ok...I tried it with both DLLs,the one that comes with the demo and the one I made.The result is the same,after alt +F4 I get :'Tiled.exe has encountered a problem and needs to close.'I named my build project 'Tiled'.
Besides those 2 compilers I have tried it with the free Borland command line tools,BCC55.With the same result.
I do not have any Microsoft compilers installed at the moment.
I have a copy of Microsoft 2003 on a backup CD someplace,let me try that.
Besides those 2 compilers I have tried it with the free Borland command line tools,BCC55.With the same result.
I do not have any Microsoft compilers installed at the moment.
I have a copy of Microsoft 2003 on a backup CD someplace,let me try that.
I'm going to give a shot at translating this source to VB.Net, if I do it right, the resulting class should be compatable with the rest of the .Net languages. I know just enough C++ to wade my way through, the only problem being struct inheritance. VB structures can't inherit, so I'm going to have to go into the Irrlicht header files to find some of the parent definitions. Also, a lot of structs used in the original Cpp source would probably be better as simple classes in VB.
If somone has already ported this to .Net, please let me know before I get deeper into this.
Arras, this is a wonderful class you've built.
If somone has already ported this to .Net, please let me know before I get deeper into this.
Arras, this is a wonderful class you've built.
"I got a present for you" -Commando
"May the way of the Hero Lead to the Triforce" -If you have to ask, I'll beat you with a herring
"May the way of the Hero Lead to the Triforce" -If you have to ask, I'll beat you with a herring
Thanks C4Cypher. neotoma was working on some wrapper lately but I dont know status of his work. As for VB unfortunately I have no knoweledge of it so I cant help. As for structures and classes in C++ only diference is default public/private setup and for classes constructor and destructor is automaticly created by compiler if you dont provide one.
Good luck.
Good luck.
For the time being, I'm shifting focus to a more .net friendly environment, and I'm trying to design my own terrain algorythm, but I'm going to be borrowing from arra's design, and I'll be giving him an acknowledgement in my code.
I'm hoping to abstract the game engine from the rendering process to the point that migrating it to different rendering engines will be a simple process, so a possible port to irrlicht in one of it's forms is a future possibility. Thanks guys for your help, discussion and all of the wonderful documentation.
I'm hoping to abstract the game engine from the rendering process to the point that migrating it to different rendering engines will be a simple process, so a possible port to irrlicht in one of it's forms is a future possibility. Thanks guys for your help, discussion and all of the wonderful documentation.
"I got a present for you" -Commando
"May the way of the Hero Lead to the Triforce" -If you have to ask, I'll beat you with a herring
"May the way of the Hero Lead to the Triforce" -If you have to ask, I'll beat you with a herring
I use ShTLTerrainSceneNode in my project, but it had a lot of signed/unsigned warnings. I edited it, so that it doesn't throw any warning. Here is the edited code:
http://ebbsoft.netgames.lv/files/ShTlTerrainSceneNode.zip
P.S. I have changed nothing in the code but the types of variables to signed/unsigned where needed. If you plan to continue developing it arras, please use my code, so that it is safe against data loss (signed/unsigned missmatch).
http://ebbsoft.netgames.lv/files/ShTlTerrainSceneNode.zip
P.S. I have changed nothing in the code but the types of variables to signed/unsigned where needed. If you plan to continue developing it arras, please use my code, so that it is safe against data loss (signed/unsigned missmatch).
Cool.
Its a nice idea. Do you want to send it to me ? I can host this file.
Send to my email if you want: rodrigo.rwrz@gmail.com
Thanks
Now, another question ... To make a larger view of terrain, i just need to chenge the tileSize ? So i can render bigger terrains, right ?
But i will can put only 1 texture per tile ? Or i can put a texture in a half of a tile ?
Thanks
Rodrigo
Its a nice idea. Do you want to send it to me ? I can host this file.
Send to my email if you want: rodrigo.rwrz@gmail.com
Thanks
Now, another question ... To make a larger view of terrain, i just need to chenge the tileSize ? So i can render bigger terrains, right ?
But i will can put only 1 texture per tile ? Or i can put a texture in a half of a tile ?
Thanks
Rodrigo
In Lak'Ech
Im another of you!
Im another of you!
elvman >> thanks a lot, realy nice from you. I use Dev C++ and I would need to switch to another compiler in order to clean it up.
rwrz >> Try to awoid collision detection with terrain if possible. Its slow. Mostly what you need is getHeight() function. Terrain also include getIntersectionWithLine() function for line of sight, bullet collision or similar. I spended lot of time optimizing it.
rwrz >> Try to awoid collision detection with terrain if possible. Its slow. Mostly what you need is getHeight() function. Terrain also include getIntersectionWithLine() function for line of sight, bullet collision or similar. I spended lot of time optimizing it.
Right. Or you can increase size of vissible mesh. That will decrease performance of course.To make a larger view of terrain, i just need to chenge the tileSize
Terrain use only one texture (well it use 2 but one of them is created internaly). This texture however can be put together from seweral smaller textures (texture tiles). Terrain contain functions which allowe you to set UV coordinates of individual tiles so each tile can display diferent texture tile.But i will can put only 1 texture per tile ? Or i can put a texture in a half of a tile ?
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
Yes:
Following code will create the same terrain as Irrlicht TerrainRendering example. All textures are one from this example. You can find them in Irrlicht media directory.
Only diference will be scale of terrain-texture.jpg since it is larger than terrain itself.
Following code will create the same terrain as Irrlicht TerrainRendering example. All textures are one from this example. You can find them in Irrlicht media directory.
Code: Select all
#include <irrlicht.h>
using namespace irr;
#include "ShTlTerrainSceneNode.h"
int main()
{
IrrlichtDevice *device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600), 32, false, false, false, 0);
video::IVideoDriver *driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
// create terrain scene node
ShTlTerrainSceneNode* terrain = new ShTlTerrainSceneNode(smgr, 255, 255, 1, 100);
terrain->drop();
// load height data from texture
terrain->loadHeightMap("terrain-heightmap.bmp", 10);
// load color map
terrain->loadColorMap("terrain-texture.jpg");
// set detail texture
terrain->setMaterialTexture(0, driver->getTexture("detailmap3.jpg"));
// smooth normals
terrain->smoothNormals();
terrain->setMaterialFlag(video::EMF_LIGHTING, false);
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
// set terrain to follow camera
terrain->follow(camera);
while(device->run())
{
driver->beginScene(true, true, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact: