SpaceFlightDemo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

SpaceFlightDemo

Post by arras »

I was going little bit forward with my small test program.
Thanks to jox for helping me with rotation problem and his fix for matrix4::getRotationDegrees() http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2234

new features include:

Camera is no more static, two modes added:
-fly by camera
-cockpit camera with simple crosshair

Improved background texture a little bit.

Added piece of space rock to have something to fly around,
collision is not set up yet, so you can fly trough it.

Added dynamic engine fire.

I would be happy to get feetback from you, for example I would like to know on hove many fps its running on your computer (with basic info on your configuration)

Also it seems to me that camera is making ugly jumps when in cockpit view turning hard, do you notice the same?

You can download demo on my page: http://members.lycos.co.uk/arras1

Image
VeneX
Posts: 228
Joined: Sun Nov 30, 2003 3:32 pm
Location: The Netherlands
Contact:

Post by VeneX »

Irrlicht.dll is not included and the dll of version 5 and varsion 6 won't work... Can you include the dll?
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

You're welcome!

Your download seems to contain the old version. I dont see no space rock. And font color is still black. Also the file dates in the zip is 07.06.2004.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

:oops: That's becouse i forget to check download afther uploading it on site, I targeted old file.
...excuse me it is corrected already...
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

> Also it seems to me that camera is making ugly jumps when in cockpit
> view turning hard, do you notice the same?

Look smooth on my PC.

Nice engine fire effect. Add some badies so we can shoot'em :twisted:
Tomasz Nowakowski
Openoko - www.openoko.pl
//.Razor
Posts: 42
Joined: Sun Jun 06, 2004 12:09 am

Post by //.Razor »

i really need to find out how to do that :?
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

Do what ?
Tomasz Nowakowski
Openoko - www.openoko.pl
//.Razor
Posts: 42
Joined: Sun Jun 06, 2004 12:09 am

Post by //.Razor »

that dynamic fire thing
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

warui>> next I plan to put there some star dust field and colision detection. When its done I'll put some target to firepractice ;)

//.Razor>> that's wery simple, make cone with texture (you can look at tail.x and tail.bmp) and animate it in your modeling program, then you make it parent of ship, position it on right place acording to ship, make it ignore light so it is always bright, set it transparent so you cant see black areas on texture, animate it.

node is parent node -space ship:

Code: Select all

//--- LOAD AND ANIMATE ENGINE FIRE ---
   tailmesh = device->getSceneManager()->getMesh("Media/tail.x");
   tailnode = device->getSceneManager()->addAnimatedMeshSceneNode(tailmesh, node);
   if (tailnode)
   {
      tailnode->setMaterialFlag(irr::video::EMF_LIGHTING, false);
      tailnode->setMaterialType(irr::video::EMT_TRANSPARENT_ADD_COLOR);
      tailnode->setPosition(irr::core::vector3df(0,0,-4.04));
      tailnode->setFrameLoop(0, 3);
      tailnode->setAnimationSpeed(24);
   }

then you control it each loop and make its scale dependant on speed.

destspeed = actual speed set by player
maxspeed = maximum speed ship can reach

Code: Select all

//--- CONTROL SCALE OF ENGINE FIRE ...HIGHER SPEED = LONGER FIRE ---
void shipObject::tailControl()
{
   irr::core::vector3df scale = tailnode->getScale();

   float setscale = destspeed / maxspeed;
  
   if(scale.Z < setscale)
   {
      scale.Z += 0.01;
      if(scale.Z > setscale) scale.Z = setscale;
      tailnode->setScale(scale);
   }
      
   if(scale.Z > setscale)
   {
      scale.Z -= 0.01;
      if(scale.Z < setscale) scale.Z = setscale;
      tailnode->setScale(scale);
   }
}
StuCollier
Posts: 52
Joined: Tue Mar 30, 2004 12:16 pm

Post by StuCollier »

Nice and smooth here on an XP2400. over 300fps in DX mode.

Any chance of sharing your Camera code ? - in particular the "Roll" code used in the cockpit view ? Theres been quite a few posts asking how todo it :oops:
StuC
Freeware games
www.ovine.net
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Running smoothly here :)
I'm also interested in your camera...
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Thanks, 300fps is preaty much I have to make my physic system time dependant or it can be unplayable on some computers :)

Trick with camera is simple, I just set upvector of the camera. Here is code:

parent = parent node, in this case space ship

Code: Select all

void cameraObject::control()
{
   ...
   if (mode == 2)  //cockpit camera
   {
      irr::core::matrix4 m;
      m.setRotationDegrees( parent->getRotation() );
      
      irr::core::vector3df v = irr::core::vector3df(0, 0, 100); //target
      irr::core::vector3df u = irr::core::vector3df(0, 1, 0); //up vector
      m.transformVect(v);
      v += parent->getPosition();
      m.transformVect(u);

      camera->setUpVector(u);
      camera->setTarget(v);
   ...
   }
}

For turn/pitch/roll code you can look at this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2690
masfworld
Posts: 9
Joined: Thu Sep 30, 2004 10:29 pm

problems with the camera rotation

Post by masfworld »

i have implemented the code up and that don't work me. i want rotate the camera, but i don't want change the position of camera, that is, to rotate to right and left x degrees

Code: Select all

void cameraObject::control() 
{ 
   ... 
   if (mode == 2)  //cockpit camera 
   { 
      irr::core::matrix4 m; 
      m.setRotationDegrees( parent->getRotation() ); 
      
      irr::core::vector3df v = irr::core::vector3df(0, 0, 100); //target 
      irr::core::vector3df u = irr::core::vector3df(0, 1, 0); //up vector 
      m.transformVect(v); 
      v += parent->getPosition(); 
      m.transformVect(u); 

      camera->setUpVector(u); 
      camera->setTarget(v); 
   ... 
   } 
}
thank you
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Hmmm ...I don't think I understand you right. Code above works without need of moving camera. It just take rotation of ship and rotate camera acordingly. You can use standard commands if you need to rotate camera just around X axis.
My code works if you need to roll camera to the sides.

May be you can be more specific...
masfworld
Posts: 9
Joined: Thu Sep 30, 2004 10:29 pm

problems with the camera rotation

Post by masfworld »

i have implemented a fps camera. I need rotate the camera aroun X axis and Y axis. i don't know do it. can you help me please? thank you.
Post Reply