Page 2 of 5

Posted: Fri Mar 09, 2007 8:16 am
by Strong99
Nice solarsytem but i got a FPS of 5 and the buttons and windows don't work how they are supossed to work :P

i have a pentium 3.0 GHZ and radeon 9600

Posted: Fri Mar 09, 2007 11:27 am
by Midnight
other then the transperent not bright enough sun and the ugly textured pluto moon.. which scientist generally do not accept as a planet anymore.

this thing is remarkabley detailed you even have jupitures moons how cool!!

it may not be scaled correctly but the weather around earth and the accurate textures make this cool to play with.

the number 4 makes time look cheap and if your on the wrong side of the shade you get a bit lost but this thing is definatly cool. 8)

i got 72 fps on speed 2.


where did you get the textures?!?!

Posted: Fri Mar 09, 2007 12:38 pm
by greenya
Midnight wrote:where did you get the textures?!?!
indeed from different places. you can simply search in Google Images for "Large Images" for something like "Earth Texture" and so on.

here is couple of very detailed textures ( 2500 x 1250 ): http://www.oera.net/How2/TextureMaps2.htm

here is very nice site with textures ( 1024 x 512, but for all planets ):
http://planetpixelemporium.com/planets.html

p.s.: indeed all satellites of jupiter ( and all other planets ) moves on a single orbit ( a circle around the planet, like saturn has ) --- but not like flies as in my application --- that's my bad.

Posted: Fri Mar 09, 2007 2:13 pm
by BlindSide
I just tried this its awesome. Can you share with use how you did the atmosphere cloud layer for earth? And the texture for it...

Posted: Fri Mar 09, 2007 5:31 pm
by greenya
BlindSide wrote:I just tried this its awesome. Can you share with use how you did the atmosphere cloud layer for earth? And the texture for it...
the answer on your question is hidden in map.dat ( this is ordinary text file ):

Code: Select all

...
AnimatedMesh
media/sphere.x
{
	Object {
		Name Earth
		Rotation 90.0 0.0 23.45
		Scale 0.5 0.5 0.5
	}
	Material {
		LayerTexture media/Earth/diffuse.jpg
	}
	RotationAnimator {
		Rotation 0.0 0.04 0.0
	}
	FlyCircleAnimator {
		Center 0.0 0.0 0.0
		Direction 0.0 1.0 0.0
		Radius 500.0
		Speed 0.000000199
	}
}

AnimatedMesh
media/sphere.x
{
	Object {
		Name Earth_Clouds
		Parent Earth
		Scale 1.01 1.01 1.01
	}
	Material {
		Type EMT_TRANSPARENT_ADD_COLOR
		LayerTexture media/Earth/clouds.jpg
	}
	RotationAnimator {
		Rotation 0.0 0.0 -0.02
	}
}
...
texture media/Earth/clouds.jpg -- lies in media.dat ( this is ordinary ZIP archive ) -- the clouds is gray texture where where much whiter color is clouds ( and opaque in same time ) and more blacker color is more transparent.

Earth_Clouds object has Earth object as parent, that means that position and all rotation/scale changes that will be applied to Earth object -- will be also reflected on Earth_Clouds -- that what we just need in here, because clouds should stay alway on Earth.

Possible all said above is not very necessary for you. The main thing ( to get the effect of clouds as in my application ) is to set material type of clouds as EMT_TRANSPARENT_ADD_COLOR --- this parameter makes possible to get black -- transparent and white -- non transparent ( but stay white ) --- this is only useful with clouds ( because its white ). what i trying to say -- if clouds would be yellow or red ( for example ) -- EMT_TRANSPARENT_ADD_COLOR -- will not help us, because it summing colors = blue+blue, green+green and red+red ------ hope that's all very clear, if not -- ask me.

Posted: Sat Mar 10, 2007 6:43 pm
by greenya
Hi again.

Solar Model 1.1 Released :)
Here all details ( binaries [4mb], sources [50kb], screenshots ) -- http://sourceforge.net/projects/solarmodel/

Here is V1.1 Notes
---------------------
+ Removed transparency from Sun texture.
+ Increased Sun’s brightness.
+ Fixed some grammar mistakes.
+ Fixed wrong textures of Uranus, Neptune and Pluto.
+ Changed diffuse textures for more detailed for such planets/moons: Sun, Mercury, Venus, Moon, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto. Also space stars texture now got 1024x1024 size.
+ Added atmospheric glow to Earth.
+ Added configuration file (config.dat). It contains all information about what driver to use for rendering, what resolution, use full screen or not and more.
+ Charon’s over Pluto rotation period fixed. Charon’s description added.

***
In future i plaining to make sizes and distances real-relative, add couple of dwarf-planets, add moons to Neptune, fix rotation trajectories of moons for some planets ( like Jupiter ), etc.

2 hybrid:
1) now i have reworked a little the sources so it doesn't includes windows.h -- hope this will reduce problems with porting to linux with no problems;
2) one of the features of this release is that it uses config.dat -- just what you needed -- you can set up Irrlicht device just right from this file.

=======================
Now questions to Irrlicht's gurus:
=======================

1) how can i send close window message to main window ? ( or how to programmly emulate alt+f4 user pressing ? ). in sources you can see that i have made it like:

Code: Select all

...
	if ( event.EventType == EET_GUI_EVENT && event.GUIEvent.EventType == EGET_BUTTON_CLICKED && event.GUIEvent.Caller->getID()==111 )
	{
		/*FIXME*/Game.Device->closeDevice();
		return true;
	}
...
is this ok ??

2) why when i executing this source:

Code: Select all

...
case KEY_SPACE:
			cam_inputreceive ^= true;
			Game.Cursor->setVisible( ! cam_inputreceive );
			if ( cam_inputreceive ) Game.Cursor->setPosition( 0.5f, 0.5f );
			Game.Scene->getActiveCamera()->setInputReceiverEnabled( cam_inputreceive );
			break;
...
i do not see a mouse pointer until i move the mouse -- why it so ??

3) i have compiled totally same source in to variants: RELEASE and DEBUG -- you can find this files in downloaded ZIP ( binaries 1.1 ). the only one difference is when i pressing SPACE ( when switching from Picking mode to FPS mode ) i getting forward movement of the camera ?? ( it is like W key is pressed very quick :::: please try RELEASE executable and try to press SPACE couple of times, than execute DEBUG -- you will not get any problems like with RELEASE version :shock: ) <---- this all is most strange i guess [[[ please, check this -- very possible that this is some Irrlicht bug :( ]]].

Posted: Tue Mar 20, 2007 8:40 pm
by greenya
Hi!

Solar Model 1.2 Released.

v1.2 Notes

+ Added ability to link camera LookFrom and LookAt points with space objects.
+ Added ability to switch on/off labels on objects.
+ Added Ceres dwarf planet.
+ Added ring to Uranus.
+ Added number of moons with descriptions (and all "old" moons reviewed). Fixed rotating traectories.
+ Added original textures of main moons of the planets.
+ Added real angles to orbits of Eris, Pluto and Neptune.
+ Fixed shifted object picking.
+ Fixed screen blinking when changing time flow speed.
+ SysInfo feature added.
+ Help feature added.
+ Pluto's and Charon's textures changed.
+ Number of object's description updated.
+ Adopted space object proportions. Sun updated to smaller size ( indeed Sun more than 1 million times bigger of Earth ). Lets ignore Sun's size and distance to Earth, so now from Earth Sun looks like real; Moon some times can hide the Sun makes solar eclipse possible.
+ Updated to latest IrrLicht library (vesion 1.3, revision 568).
+ Fixed found grammar mistakes.

Home page -- http://solarmodel.sourceforge.net/
Downalod page -- http://solarmodel.sourceforge.net/downloads.html

Now Solar Model works with latest irrlicht ver. 1.3 rev. 568 ( because i needed working ISceneNode::getType() for switching on/off text labels on objects ). As i have compiled sources of irrlicht by myself -- i got dll that cannot render with direct3d because directx sdk is needed for this.... it is renders with opengl... i guess this is not very big problem.

Edit "config.dat" to specify what renderer to use, use fullscreen or not, use antialiasing or not etc.

and screenshot:
Image

More screenshots can be found in the gallery -- http://solarmodel.sourceforge.net/gallery.html

:roll: :roll: :roll:

Posted: Wed Mar 21, 2007 7:47 am
by BlindSide
Hey have you thought about maybe adding some bumpmapping to the planets?

Posted: Wed Mar 21, 2007 10:58 am
by greenya
BlindSide wrote:Hey have you thought about maybe adding some bumpmapping to the planets?
yes i have :)
maybe next time some planets and moons will have bumpmappings.

---------------------

also i thinking about very neccessary part of the space --- asteroid beld --- it is situated between Mars and Jupiter. details can be found here -- http://en.wikipedia.org/wiki/Asteroid_belt

Does anybody have any ideas how to implemet it ?

Posted: Wed Mar 21, 2007 11:32 am
by CmdKewin
Nice progress :D Keep up.
greenya wrote: also i thinking about very neccessary part of the space --- asteroid beld --- it is situated between Mars and Jupiter. details can be found here -- http://en.wikipedia.org/wiki/Asteroid_belt

Does anybody have any ideas how to implemet it ?
Uhm. What about generating an ellipse of points, and attach asteroid meshes in random X,Y,Z to those points? Between an interval (let's say +- 5), and you should get something "nice to see". maybe not. Add random rotation to the equation too. That's how I do it.

Generating an elipse of points, take from my "current project(TM)".

Code: Select all

IMesh* CreateEllipse(float a, float b)
{
	SMesh* msh = new SMesh();
	SMeshBuffer* mb = new SMeshBuffer();
	msh->addMeshBuffer(mb);

	S3DVertex t_vtx[360];

	float x,y,z;

	for(int i=0; i<360; i++)
	{
		float degInRad = i*DEG2RAD;

		x = cos(degInRad)* a;
		y = sin(degInRad)* b;
		z = 0.0f;

		t_vtx[i] = S3DVertex(vector3df(x,y,z),vector3df(0,1,0),SColor(0, 0, 0, 255),vector2df(0,0));
	}

	for (int l = 0; l < 360; l++)
	{
		mb->Vertices.push_back(t_vtx[l]);
		mb->Indices.push_back(l);
	}

	mb->recalculateBoundingBox();
	return msh;
}
It's actually a mesh, but still, hope it's clear enough.

Posted: Wed Mar 21, 2007 3:00 pm
by BlindSide
Yeah thats a great idea just take a sin/cos and multiply by a random degree on a set distance from the sun, taking around a hundred point or so, then give it some random offsets so they are not all on a straight circle, a random spinning velocity, and it will look gravy, i hope. (A good a idea to avoid too much performance loss is to replace asteriods with an LOD billboard image when they are far away it will not be that noticable but will be much faster. This might also work for the sun and some planets (Maybe saturn). Although the billboard idea for planets will be problematics in terms of the lighting (Though you can maybe have 2 different images for which side from the sun you are looking at). It should be easy for asteroids though, good luck with that and also the bumpmapping (You may have a problem with the smooth shading when bumpmapping is applied though, something to do with tangents...)

Posted: Wed Mar 21, 2007 5:28 pm
by greenya
CmdKewin, thank you for the code sample. After reworking and adopting i have got this:

Code: Select all

#define DEG2RAD (3.1415f/180.0f)
#define GAME_MAIN_BELT_RADIUS 830.0f
#define GAME_MAIN_BELT_ASTEROID_COUNT 2000
void GameAddAsteroidBelt()
{ 
	u32 c;

	SMesh* msh = new SMesh();
	SMeshBuffer* mb = new SMeshBuffer();
	msh->addMeshBuffer(mb);

	S3DVertex t_vtx[ GAME_MAIN_BELT_ASTEROID_COUNT ];

	float x,y,z;

	for(int i=0; i<GAME_MAIN_BELT_ASTEROID_COUNT; i++)
	{ 
		float degInRad = i*DEG2RAD;

		x = (float)cos(degInRad)* GAME_MAIN_BELT_RADIUS + ( ((float)((rand()%10000)-5000)) / 70.0f );
		z = (float)sin(degInRad)* GAME_MAIN_BELT_RADIUS + ( ((float)((rand()%10000)-5000)) / 70.0f );
		y = 0.0f + ( ((float)((rand()%10000)-5000)) / 250.0f );

		c = 50 + (rand()%100);
		t_vtx[i] = S3DVertex(vector3df(x,y,z),vector3df(0,0,1),SColor(255, c, c, c),vector2df(0,0));
	} 

	for (int i = 0; i < GAME_MAIN_BELT_ASTEROID_COUNT; i++)
	{ 
		mb->Vertices.push_back(t_vtx[i]);
		mb->Indices.push_back(i);
	} 

	mb->recalculateBoundingBox();

	ISceneNode* node = Game.Scene->addMeshSceneNode( msh );
	node->addAnimator( Game.Scene->createRotationAnimator( vector3df(0.0f,0.00003f,0.0f) ) );

	node->setMaterialFlag( EMF_POINTCLOUD, true );
	node->setMaterialFlag( EMF_LIGHTING, false );
	node->setMaterialFlag( EMF_BACK_FACE_CULLING, false );
}
and the screenshot:
Image

looks good for me. but 1 problem is still persists: some times the belt desapers when i flying.... i guess it is because of somehow irrlicht think that it shouldn't be drawn because it is invisible or what ?

is any solution how to tell irrlicht to draw the object all the time ?

Posted: Wed Mar 21, 2007 6:00 pm
by CmdKewin
Glad to have been helpful ;)

An regarding the other problem... Maybe it has something todo with Z-Culling? You can probably adjust that by tweaking your camera's Far and Near values. Not sure though.

Posted: Wed Mar 21, 2007 7:51 pm
by hybrid
Disable the AutomaticCulling to always to draw it.

Posted: Wed Mar 21, 2007 8:21 pm
by greenya
hybrid wrote:Disable the AutomaticCulling to always to draw it.
i didn't disabled it, but set to EAC_FRUSTUM_BOX -- now all looks OK.

Thank You :)