I worked now a few days to solve the problem, but it doesn't work. Propably I do something basicly wrong. I try to load an .x file (it is a ball with a wall texture). It loads the mesh!! but no matter what I can't see the object or it throws errors.
Do I need a mesh viewer to see a mesh? Do I need to have a texture to see the the object? What exactly to I have to include?
That is what I have right now:
#include <irrlicht.h>
#include <stdio.h>
#include <wchar.h>
#include <windows.h>
static irr::IrrlichtDevice* s_pDevice = NULL;
//-------------------------------------------------------
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
irr::scene::IAnimatedMeshSceneNode *model_node = 0;
s_pDevice = irr::createDevice(irr::video::EDT_SOFTWARE,
irr::core::dimension2d<irr::s32>(1024, 768),
16, false, false);
irr::gui::IGUIEnvironment* GuiEnv = s_pDevice->getGUIEnvironment();
irr::video::IVideoDriver* Video = GuiEnv->getVideoDriver();
irr::scene::ISceneManager* smgr = s_pDevice->getSceneManager();
//---------------------------------------------------------------------------------
irr::scene::IAnimatedMesh *model = smgr->getMesh("D:\\Irrlicht\\irrlicht-0.6\\Map_Test\\RadiantTest\\ball2.x");
irr::gui::IGUIMeshViewer* mesh_viewer = GuiEnv->addMeshViewer(irr::core::rect<irr::s32>(110,190,370,380), 0, 500, L"Viewer");
mesh_viewer->setMesh(model);
irr::video::SMaterial material;
material.Lighting = false;
material.Flags[irr::video::EMF_GOURAUD_SHADING]=true;
material.AmbientColor = irr::video::SColor(255,255,255,255);
material.MaterialType = irr::video::EMT_SOLID;
mesh_viewer->setMaterial(material);
.
.
.
In the red line I get the error. But if i don't have a meshviewer an just add a node, it doesn't show anything
Please help!!
load and show Mesh
-
Guest
-
Guest
-
Guest
-
Guest
Mmmh, still doesn't show anything . I added:
irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNode();
camera->setPosition(irr::core::vector3df(-50,50,-150));
Any new idea?
Oh, it compiles but I see it throws a message in the debug-mode:
Unknown data object in x file: Header
No finishing semicolon in Transformation Matrix found in x file
Loaded mesh: D:\Irrlicht\irrlicht-0.6\Map_Test\RadiantTest\ball2.x
irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNode();
camera->setPosition(irr::core::vector3df(-50,50,-150));
Any new idea?
Oh, it compiles but I see it throws a message in the debug-mode:
Unknown data object in x file: Header
No finishing semicolon in Transformation Matrix found in x file
Loaded mesh: D:\Irrlicht\irrlicht-0.6\Map_Test\RadiantTest\ball2.x
-
Guest