Corroding Games
http://corrodinggames.com/forums/

Update (Anaglyph mode, and lua scripts)
http://corrodinggames.com/forums/viewtopic.php?f=1&t=16
Page 1 of 1

Author:  luke [ Mon May 04, 2009 12:30 pm ]
Post subject:  Update (Anaglyph mode, and lua scripts)

been playing around with lua scripts.

eg:

setuping up a group of soldiers:

Code:
soldierGroup2={};
for i=0,2 do
    soldier=createNPC();   
    soldier:setPosition(vector3df(math.random(-19,-17),-15.1597,70.0));
    soldier.hp=400;
    soldier:SetTeam(1);
    soldier:grabWeapon( CWeapon(1) );
    soldierGroup2[i]=soldier;
end


setup an ambush:

Code:
triggerAttack=CAreaTrigger();
triggerAttack.box.MinEdge=vector3df(-4,-21.6975,30.1997);
triggerAttack.box.MaxEdge=vector3df(27.2556,-12.6975,40.1997);
triggerAttack:setExpression("moveGroupRandom(soldierGroup1, vector3df(13.2556,-18.6975,51.1997),2);");



and also been playing around with anaglyph images,


Image

Image

Image


this is the code you can use to do it in irrlicht: (free for any use)

Code:

void CGameEngine::drawAnaglyph()
{
    vector3df oldPosition=camera->getPosition();
   vector3df oldTarget=camera->getTarget();
   
   matrix4 startMatrix=camera->getAbsoluteTransformation();

   vector3df focusPoint= (camera->getTarget()-camera->getAbsolutePosition()).setLength(1) + camera->getAbsolutePosition() ;

   //Left eye...

   vector3df leftEye;
   matrix4 leftMove;
   leftMove.setTranslation( vector3df(-0.01f,0.0f,0.0f) );
   leftEye=(startMatrix*leftMove).getTranslation();

   //clear the depth buffer, and color
   driver->beginScene( true, true, SColor(0,200,200,255) );

   driver->getOverrideMaterial().Material.ColorMask=ECP_RED;
   driver->getOverrideMaterial().EnableFlags=EMF_COLOR_MASK;
   driver->getOverrideMaterial().EnablePasses=ESNRP_SKY_BOX+ESNRP_SOLID+ESNRP_TRANSPARENT+ESNRP_TRANSPARENT_EFFECT+ESNRP_SHADOW;

    camera->setPosition( leftEye );
    camera->setTarget( focusPoint );

   draw(); // 'smgr->drawAll();' may go here


   //Right eye...

   vector3df rightEye;
   matrix4 rightMove;
   rightMove.setTranslation( vector3df(0.01f,0.0f,0.0f) );
   rightEye=(startMatrix*rightMove).getTranslation();

   //clear the depth buffer
   driver->clearZBuffer();

   driver->getOverrideMaterial().Material.ColorMask=ECP_GREEN+ECP_BLUE;
   driver->getOverrideMaterial().EnableFlags=EMF_COLOR_MASK;
   driver->getOverrideMaterial().EnablePasses=ESNRP_SKY_BOX+ESNRP_SOLID+ESNRP_TRANSPARENT+ESNRP_TRANSPARENT_EFFECT+ESNRP_SHADOW;

    camera->setPosition( rightEye );
   camera->setTarget( focusPoint );

    draw(); // 'smgr->drawAll();' may go here

    driver->endScene();

   driver->getOverrideMaterial().Material.ColorMask=ECP_ALL;
   driver->getOverrideMaterial().EnableFlags=0;
   driver->getOverrideMaterial().EnablePasses=0;

    camera->setPosition( oldPosition );

    camera->setTarget( oldTarget );

}

Author:  Schiggy [ Sun Jan 03, 2010 6:08 pm ]
Post subject:  Re: Update (Anaglyph mode, and lua scripts)

wow this is the best game i have seen on irrlicht. how did you enable the hardware skinning. plz reply

Author:  luke [ Tue Jan 05, 2010 3:54 pm ]
Post subject:  Re: Update (Anaglyph mode, and lua scripts)

Quote:
wow this is the best game i have seen on irrlicht. how did you enable the hardware skinning. plz reply


hardware skinning is done with changes I committed into the irrlicht svn, basically only simple changes, like disabling software skinning. the rest was done by blindside, he has a post in the irrlicht forums about it, I'll try and find it when I get the time, as well as post my changes.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/