SpaceFlightDemo
SpaceFlightDemo
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
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
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
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
> 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
> 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
Tomasz Nowakowski
Openoko - www.openoko.pl
Openoko - www.openoko.pl
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:
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
//.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);
}
}
-
- Posts: 52
- Joined: Tue Mar 30, 2004 12:16 pm
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
For turn/pitch/roll code you can look at this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2690
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
problems with the camera rotation
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
thank you
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);
...
}
}
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...
My code works if you need to roll camera to the sides.
May be you can be more specific...
problems with the camera rotation
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.