It is currently Sat Jan 28, 2012 1:40 am




Post new topic Reply to topic  [ 3 posts ] 
 Update (Anaglyph mode, and lua scripts) 
Author Message
Site Admin

Joined: Wed Jun 27, 2007 9:33 am
Posts: 57
Post 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 );

}


Mon May 04, 2009 12:30 pm
Profile

Joined: Sun Jan 03, 2010 6:04 pm
Posts: 1
Post 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


Sun Jan 03, 2010 6:08 pm
Profile
Site Admin

Joined: Wed Jun 27, 2007 9:33 am
Posts: 57
Post 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.


Tue Jan 05, 2010 3:54 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.