ICameraSceneNode* camera; //active camera of the scene ICameraSceneNode* cP1; //camera of the first portal ICameraSceneNode* cP2; //camera of the second portal

core::vector3df dp1c; //deltaPosition between portal 1 and the camera core::vector3df dp2c; //deltaPosition between portal 2 and the camera

IAnimatedMeshSceneNode* portal1; //scene node of the first portal float Radius1; //radius of the object that compose fist portal IAnimatedMeshSceneNode* portal2; //scene node of the second portal float Radius2; //radius of the object that compose second portal

int is_p1_active; //it assumes 1 if the first portal il active int is_p2_active; //it assumes 1 if the second portal il active int passed; //this int contains the portal that you have passed

public:

//Constructor BlizPortal();

//Destructor ~BlizPortal();

//Baically in this version the lots of initialization //is made by the user such as in the sample. //This procedure initialize only the d3d pointers //and the delta vectors. //Before using this function the user/programmer must define //the device, the camera and the nodes of the portals void BP_init();

//This procedure render both the portals! ^_^ //It must be called after the smgr->drawAll() //in the scene void BP_render_portals();

//This procedure verify if the camera pass through a portal //if true, she actives the transfer and set to 0 the active value //of the portal were you are transfered. //If you exit from the portal the portal is reactivated so you //can use it to go in the previous zone // //NOTE: it's better that you define your own procedure to use //portals. If, for example, you are programming a 3rd person shooter //this function is not correct, because she evaluates the translation //of the camera. void BP_use_portals();

//Baically in this version the lots of initialization//is made by the user such as in the sample.//This procedure initialize only the d3d pointers//and the delta vectors.//Before using this function the user/programmer must define//the device, the cameras and the nodes of the portalsvoid BlizPortal::BP_init(){ IVideoDriver* driver = device->getVideoDriver();

//This procedure verify if the camera pass through a portal//if true, she actives the transfer and set to 0 the active value//of the portal were you are transfered.//If you exit from the portal the portal is reactivated so you//can use it to go in the previous zone////NOTE: it's better that you define your own procedure to use//portals. If, for example, you are programming a 3rd person shooter//this function is not correct, because she evaluates the translation//of the camera.void BlizPortal::BP_use_portals(){

/*This Tutorial shows how to load a Quake 3 map into theengine, create a SceneNode for optimizing the speed ofrendering and how to create a user controlled camera.

Lets start like the HelloWorld example: We includethe irrlicht header files and an additional file to be ableto ask the user for a driver type using the console.*/#include <irrlicht.h>#include <iostream>

#include "BlizPortal.h"

/*As already written in the HelloWorld example, in the IrrlichtEngine, everything can be found in the namespace 'irr'. To get rid of the irr:: in front of the name of every class,we tell the compiler that we use that namespace from now on, and we will not have to write that 'irr::'.There are 5 other sub namespaces 'core', 'scene', 'video','io' and 'gui'. Unlike in the HelloWorld example,we do not a 'using namespace' for these 5 other namespacesbecause in this way you will see what can be found in whichnamespace. But if you like, you can also include the namespaceslike in the previous example. Code just like you want to.*/using namespace irr;

/*Again, to be able to use the Irrlicht.DLL file, we need to link with the Irrlicht.lib. We could set this option in the project settings, butto make it easy, we use a pragma comment lib:*/#pragma comment(lib, "Irrlicht.lib")

/*Ok, lets start. Again, we use the main() method as start, not theWinMain(), because its shorter to write.*/int main(){ /* Like in the HelloWorld example, we create an IrrlichtDevice with createDevice(). The difference now is that we ask the user to select which hardware accelerated driver to use. The Software device would be too slow to draw a huge Quake 3 map, but just for the fun of it, we make this decision possible too. */

/* Get a pointer to the video driver and the SceneManager so that we do not always have to write device->getVideoDriver() and device->getSceneManager(). */ video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager();

/* To display the Quake 3 map, we first need to load it. Quake 3 maps are packed into .pk3 files wich are nothing other than .zip files. So we add the .pk3 file to our FileSystem. After it was added, we are able to read from the files in that archive as they would directly be stored on disk. */ device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3");

/* Now we can load the mesh by calling getMesh(). We get a pointer returned to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, they are only a huge chunk of static geometry with some materials attached. Hence the IAnimated mesh consists of only one frame, so we get the "first frame" of the "animation", which is our quake level and create an OctTree scene node with it, using addOctTreeSceneNode(). The OctTree optimizes the scene a little bit, trying to draw only geometry which is currently visible. An alternative to the OctTree would be a AnimatedMeshSceneNode, which would draw always the complete geometry of the mesh, without optimization. Try it out: Write addAnimatedMeshSceneNode instead of addOctTreeSceneNode and compare the primitives drawed by the video driver. (There is a getPrimitiveCountDrawed() method in the IVideoDriver class). Note that this optimization with the Octree is only useful when drawing huge meshes consiting of lots of geometry. */ scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp"); scene::ISceneNode* node = 0;

if (mesh) node = smgr->addOctTreeSceneNode(mesh->getMesh(0));

/* Because the level was modelled not around the origin (0,0,0), we translate the whole level a little bit. */ if (node) node->setPosition(core::vector3df(-1300,-144,-1249));

node->setScale(core::vector3df(2,2,2));

smgr->addSkyBoxSceneNode( driver->getTexture("../../media/irrlicht2_up.jpg"), driver->getTexture("../../media/irrlicht2_dn.jpg"), driver->getTexture("../../media/irrlicht2_lf.jpg"), driver->getTexture("../../media/irrlicht2_rt.jpg"), driver->getTexture("../../media/irrlicht2_ft.jpg"), driver->getTexture("../../media/irrlicht2_bk.jpg")); /* Now we only need a Camera to look at the Quake 3 map. And we want to create a user controlled camera. There are some different cameras available in the Irrlicht engine. For example the Maya Camera which can be controlled compareable to the camera in Maya: Rotate with left mouse button pressed, Zoom with both buttons pressed, translate with right mouse button pressed. This could be created with addCameraSceneNodeMaya(). But for this example, we want to create a camera which behaves like the ones in first person shooter games (FPS). */ ICameraSceneNode* c=smgr->addCameraSceneNodeFPS(); c->setPosition(core::vector3df(1837,122,1420)); c->setRotation(core::vector3df(0,270,0));

/* The mouse cursor needs not to be visible, so we make it invisible. */

device->getCursorControl()->setVisible(false);

/* We have done everything, so lets draw it. We also write the current frames per second and the drawn primitives to the caption of the window. The 'if (device->isWindowActive())' line is optional, but prevents the engine render to set the position of the mouse cursor after task switching when other program are active. */ int lastFPS = -1;

BlizPortal p; //declare a BlizPortal

p.device=device;

//example p.camera=c; p.cP1=cp1; p.cP2=cp2;

//NOTE: the portals can't be both activated p.is_p1_active=0; p.is_p2_active=1;

if you wanna make it pretty like that pic you posted, just add a few meshes and textures. get 2 animated tex's(for the 'glowing ring', 1 from the side, another fromt the front), a directional strobe light, and a surrounding non-collision mesh.

sounds like a lot, but its nothing more than 3 pictures, a light, and a nurbs ring! you can set it all inside one class, the camera init, and everything, with a pointer reference to its counterpart!

also, dont' forget unreal in your examples

When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.

I've think to use the billboarding to make a ring un the portal, but I've not implemented that feature, because if you see the implementation you can use as portal a sphere, a flat mesh or... anything you want such as a teapot or a walking man ^_^

The geometry you select (can you imagin a walking man as portal??), modify the ring glow that surround it.

For the other particulars you are right, if I've time I implement them....

Anyone ask to me the license of the code release
I write a thing:
I've not put a license on the code of the portals but if someone use this code, please write in a print screen or in a readme file:

ICameraSceneNode* camera; //active camera of the scene ICameraSceneNode* cP1; //camera of the first portal ICameraSceneNode* cP2; //camera of the second portal

core::vector3df dp1c; //deltaPosition between portal 1 and the camera core::vector3df dp2c; //deltaPosition between portal 2 and the camera

IAnimatedMeshSceneNode* portal1; //scene node of the first portal float Radius1; //radius of the object that compose fist portal IAnimatedMeshSceneNode* portal2; //scene node of the second portal float Radius2; //radius of the object that compose second portal

int is_p1_active; //it assumes 1 if the first portal il active int is_p2_active; //it assumes 1 if the second portal il active int passed; //this int contains the portal that you have passed

public:

//Constructor BlizPortal(); BlizPortal(IrrlichtDevice* dev);

//Destructor ~BlizPortal();

//Baically in this version the lots of initialization //is made by the user such as in the sample. //This procedure initialize only the d3d pointers //and the delta vectors. //Before using this function the user/programmer must define //the device, the cameras and the nodes of the portals void BP_init();

//Baically in this version the lots of initialization //is made by the user such as in the sample. //This procedure initialize only the d3d pointers //and the delta vectors. //Before using this function the user/programmer must define //the device // //fileM1 is the filename of the mesh that you want to load in the //first portal node //fileM2 is the filename of the mesh that you want to load in the //second portal node void BP_init(char* fileM1, char* fileM2);

//This procedure render both the portals! ^_^ //It must be called after the smgr->drawAll() //in the scene void BP_render_portals();

//This procedure verify if the camera pass through a portal //if true, she actives the transfer and set to 0 the active value //of the portal were you are transfered. //If you exit from the portal the portal is reactivated so you //can use it to go in the previous zone // //NOTE: it's better that you define your own procedure to use //portals. If, for example, you are programming a 3rd person shooter //this function is not correct, because she evaluates the translation //of the camera. void BP_use_portals();

//Baically in this version the lots of initialization//is made by the user such as in the sample.//This procedure initialize only the d3d pointers//and the delta vectors.//Before using this function the user/programmer must define//the device, the cameras and the nodes of the portalsvoid BlizPortal::BP_init(){ IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager();

//Baically in this version the lots of initialization//is made by the user such as in the sample.//This procedure initialize only the d3d pointers//and the delta vectors.//Before using this function the user/programmer must define//the device////fileM1 is the filename of the mesh that you want to load in the//first portal node//fileM2 is the filename of the mesh that you want to load in the//second portal nodevoid BlizPortal::BP_init(char* fileM1, char* fileM2){ IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager();

//This procedure verify if the camera pass through a portal//if true, she actives the transfer and set to 0 the active value//of the portal were you are transfered.//If you exit from the portal the portal is reactivated so you//can use it to go in the previous zone////NOTE: it's better that you define your own procedure to use//portals. If, for example, you are programming a 3rd person shooter//this function is not correct, because she evaluates the translation//of the camera.void BlizPortal::BP_use_portals(){