Tutorial 2 and 7 help
Tutorial 2 and 7 help
I'm new to Irrlicht and I've got some problems with creating my own levels. Tutorial 1 (Hello world!) is no problem but when I want to create a level with FPS controls it goes wrong...
Here's the thing that goes wrong:
I use tutorial 2 as example.
I've created a map with Maya (.obj files) and replaced ("20kdm2.bsp") with ("map.obj"), so I've got this:
scene::IAnimatedMesh* mesh = smgr->getMesh("map.obj")
But then I need to create a ZipFileArchive:
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3")
I tried to make some myself but I failed to display anything.
The thing(s) I need is a valid code to walk on an .obj file (like in tutorial 7:Collision) and a valid ZipFileArchive..., so is there someone who use Maya and succeeded to display his own levels?
(And please don't say that maps are only possible as BSP files, that would be a dissaster for me.)
As C++ compiller I use Dev-C++ (may be usefull to know)
Hope someone can help me out.
Here's the thing that goes wrong:
I use tutorial 2 as example.
I've created a map with Maya (.obj files) and replaced ("20kdm2.bsp") with ("map.obj"), so I've got this:
scene::IAnimatedMesh* mesh = smgr->getMesh("map.obj")
But then I need to create a ZipFileArchive:
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3")
I tried to make some myself but I failed to display anything.
The thing(s) I need is a valid code to walk on an .obj file (like in tutorial 7:Collision) and a valid ZipFileArchive..., so is there someone who use Maya and succeeded to display his own levels?
(And please don't say that maps are only possible as BSP files, that would be a dissaster for me.)
As C++ compiller I use Dev-C++ (may be usefull to know)
Hope someone can help me out.
1st - you don't need a zip archive...
If you want one, that's another thing...
A normal zip archive (without password protection) should work...
2nd - it should all work with no problems...
Maybe you did something wrong, are you sure you specified the path to your files (archive or mesh) correct ???
3rd - you can use any mesh format you want (as far as Irrlicht supports it)...
If you want one, that's another thing...
A normal zip archive (without password protection) should work...
2nd - it should all work with no problems...
Maybe you did something wrong, are you sure you specified the path to your files (archive or mesh) correct ???
3rd - you can use any mesh format you want (as far as Irrlicht supports it)...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Owowow..
for the archive thing simply remove this line:
A path (Pfad) is also called a directory, folder or drawer
for example this: ../../media/
or this: C:\Windows\system32\
for the archive thing simply remove this line:
Code: Select all
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3")
for example this: ../../media/
or this: C:\Windows\system32\
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
An OctTree node is an optimized node, especially for maps...
The vertices of the mesh are ordered in an oct tree so only visible shapes will be drawn, this improves the speed for huge meshes...
If you look at the code you'll see a line with node = smgr->addOctTreeSceneNode(...)
For normal meshes (player, items) you don't need an oct tree node...
Simply use addAnimatedMeshSceneNode(...) then...
The vertices of the mesh are ordered in an oct tree so only visible shapes will be drawn, this improves the speed for huge meshes...
If you look at the code you'll see a line with node = smgr->addOctTreeSceneNode(...)
For normal meshes (player, items) you don't need an oct tree node...
Simply use addAnimatedMeshSceneNode(...) then...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I think this is the part where I need to "correct" something:
[ scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/map.obj");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));]
But I have no idea what I need to do with the OctTree, SceneNode or what the 3ms is I need to create... [/code]
[ scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/map.obj");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));]
But I have no idea what I need to do with the OctTree, SceneNode or what the 3ms is I need to create... [/code]
(Sorry, first time I tried to enter a code)
I think this is the part where I need to "correct" something:
But I have no idea what I need to do with the OctTree, SceneNode or what the 3ms is I need to create...
I think this is the part where I need to "correct" something:
Code: Select all
scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/map.obj");
scene::ISceneNode* node = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
But I have no idea what I need to do with the OctTree, SceneNode or what the 3ms is I need to create...
Don't think about it longer, just use an OctTree node for your map and AnimatedMeshSceneNodes for other things...
The message is simply from Irrlicht telling you that the OctTree was created successfully and how long Irrlicht took to create it...
EDIT: if you did something wrong in your post you can edit it again (there is a button "Edit" on all your posts, no need to write it double)
The message is simply from Irrlicht telling you that the OctTree was created successfully and how long Irrlicht took to create it...
EDIT: if you did something wrong in your post you can edit it again (there is a button "Edit" on all your posts, no need to write it double)
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Well, I think you just used the code from the Quake map from the tutorial...
There is a line like this:
this sets the position of the node...
But the Quake map is far away from the center (at position 1300,144,1249)...
So if you use this position with your node, it probably will be far away from the center where your camera is locatet...
Try smaller values for this position (maybe 0,0,0 or 0,0,100) then you should see your node...
There is a line like this:
Code: Select all
node->setPosition(core::vector3df(-1300,-144,-1249));
But the Quake map is far away from the center (at position 1300,144,1249)...
So if you use this position with your node, it probably will be far away from the center where your camera is locatet...
Try smaller values for this position (maybe 0,0,0 or 0,0,100) then you should see your node...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java