.irr file not rendering near screen border
Posted: Sun Apr 28, 2013 6:02 pm
Here is a .gif of my issue
http://makeagif.com/media/4-28-2013/j1MHdE.gif
as you can see, when parts of my image reach the frame of my screen, they stop being rendered
I have created a .irr file in copper-cube (the textured building)
my issue is, when parts of the .irr mesh leave the window it wont render, i'd like any parts of the mesh that are on the screen to be rendered.
Any help is greatly appreciated
I'm pretty new to irrlicht.
My code is below
Thanks
#include <irrlicht.h>
#include "ControllableCamera.h"
//#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//using namespace std;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
//---------------------------------------------------------
// ninja and mesh
IAnimatedMesh* ninjaMesh1 = smgr->getMesh("../media/ninja.b3d");
if (!ninjaMesh1)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode *ninja1 = smgr->addAnimatedMeshSceneNode( ninjaMesh1 );
if (ninja1)
{
ninja1->setMaterialFlag(EMF_LIGHTING, false);
//animate between frames
ninja1->setFrameLoop(0,13);
ninja1->setAnimationSpeed(10);
//node->setMD2Animation(scene::EMAT_FIGHT);
ninja1->setMaterialTexture( 0, driver->getTexture("../media/nskinrd.jpg") );
}
ninja1->setPosition(vector3df(-60,-60,-75));
ninja1->setScale(vector3df(3,3,3));
//-------------------------------------------------------
// coppercube scene
//load scene
ISceneNode* building = smgr->getSceneNodeFromName("building");
//Load up the coppercube building irrFile
smgr->loadScene("../media/buildingMeshh.irr",0,building);
//--------------------------------------------------------------
//Cameras, hide mouse
// first person camera. rotate speed, move speed.
ISceneNode* fpsCam1 = smgr-> addCameraSceneNodeFPS(0,120.0f, .06f);
//start position
fpsCam1->setPosition(vector3df(-78.0f,-30.0f,120.0f));
//hide cursor
device->getCursorControl()->setVisible(false);
// no parent, active - false, position, point
ISceneNode* cam1 = smgr ->addCameraSceneNode(0, vector3df(5,-10,0), vector3df(0,-20,0), 0, false);
//ISceneNode* cam2 = smgr ->addCameraSceneNode(0, vector3df(5,5,20), vector3df(0,10,5));
//--------------------------------------------------------
//while run
int lastFps = -1;
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
int fps = driver->getFPS();
if(fps != lastFps)
{
lastFps = fps;
core::stringw str = L"FPS: ";
str += fps;
str += L" Camera(";
str +=fpsCam1->getPosition().X; str += L",";
str +=fpsCam1->getPosition().Y; str += L",";
str +=fpsCam1->getPosition().Z; str+=L")";
device->setWindowCaption(str.c_str());
}
}
// drop created
device->drop();
return 0;
}
http://makeagif.com/media/4-28-2013/j1MHdE.gif
as you can see, when parts of my image reach the frame of my screen, they stop being rendered
I have created a .irr file in copper-cube (the textured building)
my issue is, when parts of the .irr mesh leave the window it wont render, i'd like any parts of the mesh that are on the screen to be rendered.
Any help is greatly appreciated
I'm pretty new to irrlicht.
My code is below
Thanks
#include <irrlicht.h>
#include "ControllableCamera.h"
//#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//using namespace std;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
false, false, false, 0);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
//---------------------------------------------------------
// ninja and mesh
IAnimatedMesh* ninjaMesh1 = smgr->getMesh("../media/ninja.b3d");
if (!ninjaMesh1)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode *ninja1 = smgr->addAnimatedMeshSceneNode( ninjaMesh1 );
if (ninja1)
{
ninja1->setMaterialFlag(EMF_LIGHTING, false);
//animate between frames
ninja1->setFrameLoop(0,13);
ninja1->setAnimationSpeed(10);
//node->setMD2Animation(scene::EMAT_FIGHT);
ninja1->setMaterialTexture( 0, driver->getTexture("../media/nskinrd.jpg") );
}
ninja1->setPosition(vector3df(-60,-60,-75));
ninja1->setScale(vector3df(3,3,3));
//-------------------------------------------------------
// coppercube scene
//load scene
ISceneNode* building = smgr->getSceneNodeFromName("building");
//Load up the coppercube building irrFile
smgr->loadScene("../media/buildingMeshh.irr",0,building);
//--------------------------------------------------------------
//Cameras, hide mouse
// first person camera. rotate speed, move speed.
ISceneNode* fpsCam1 = smgr-> addCameraSceneNodeFPS(0,120.0f, .06f);
//start position
fpsCam1->setPosition(vector3df(-78.0f,-30.0f,120.0f));
//hide cursor
device->getCursorControl()->setVisible(false);
// no parent, active - false, position, point
ISceneNode* cam1 = smgr ->addCameraSceneNode(0, vector3df(5,-10,0), vector3df(0,-20,0), 0, false);
//ISceneNode* cam2 = smgr ->addCameraSceneNode(0, vector3df(5,5,20), vector3df(0,10,5));
//--------------------------------------------------------
//while run
int lastFps = -1;
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
int fps = driver->getFPS();
if(fps != lastFps)
{
lastFps = fps;
core::stringw str = L"FPS: ";
str += fps;
str += L" Camera(";
str +=fpsCam1->getPosition().X; str += L",";
str +=fpsCam1->getPosition().Y; str += L",";
str +=fpsCam1->getPosition().Z; str+=L")";
device->setWindowCaption(str.c_str());
}
}
// drop created
device->drop();
return 0;
}