Solar Model 2.1 - 3D real time modeling of Solar System

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Solar Model 2.1 - 3D real time modeling of Solar System

Post by greenya »

The Solar Model is real time modeling of solar system. It allows user to navigate in space, to control time counting (speed-up time flow) and estimate real movement of space bodies like planets, dwarf planets and moons. It also allows user to bind camera to space objects (for example, you can look from Moon on Earth in real time flow). Solar Model renders beautiful 3D space environment.

Application has some very useful features. Some of them are: Galaxy feature that able to render Milky Way galaxy and Ruler feature that draws orbits of a planets and their projections on the Sun. As Solar Model uses own related-sizes system, which only shows what planet on which place from the Sun, how planets moves and rotates; user cannot estimate real proportions of the bodies, because real proportions will simply make all planets difficult to find in the dark space, the Sun would occupy too much place while comparing it with any other planet.

Solar Model 2.1 equipped with new feature -- Measurer, which allows you to compare and measure size of the Sun and planets in real proportions and their distance to each other.

Home:
http://sourceforge.net/projects/solarmodel/

Screenshots:
Image
Image
Last edited by greenya on Wed Sep 01, 2010 4:14 pm, edited 11 times in total.
CmdKewin
Posts: 29
Joined: Thu Aug 17, 2006 1:49 pm

Post by CmdKewin »

Nice :)

Reminds me of this http://www.youtube.com/watch?v=6UzWlMsugXo
which is a pure OpenGL project I did with a friend of mine back at the university :) Real-life relative sizes, correct orbits, angular velocities, ecc...
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

CmdKewin wrote:... Real-life relative sizes...
This is impossible to implement. I mean this is impossible to implement to stay project interesting -- it is because indeed:
- planets so far from each other;
- planets very very small relatively to distances;
- the Sun is very big relatively to all other planet sizes; ( for example if we want to get real-life relative -- when the Sun shows on all the screen, Earth will become just a 1 pixel of the screen ( indeed even less then 1 pixel ) );

that is why only planet order ( from Sun to Pluto is real ) , and relative size between planets real in some meaning ( i mean if Jupiter bigger than Earth -- it is very easy to determinate, BUT you will never guess by your eyes that Jupiter is 15 times bigger of Earth ).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe add the driver selection to allow for OpenGL support (my version of wine does not do DirectX) or even better upload the sources to make a native Linux version :D
It does look really nice from the screen shot.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

hybrid,
ok. not a problem. i will upload on SF sorces, but for linux-programmer there is a couple of work to do, because ( as i posted in Beginner Help about not working some IrrLicht functions like setVisible() ---- and this then was moved to Bug Repors :) ).

but i'm sure there is not too much troubles ;)

besides, i don't know why, but when i changing only

Code: Select all

Game.DriverType = EDT_DIRECT3D9;
on

Code: Select all

Game.DriverType = EDT_OPENGL;
i getting much ugly result than with derectx9 driver :(

p.s.: i will submit post here with "places than need redesign for linux" when i will upload sources.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

hybrid,

The source ZIP can be directly downloaded from http://downloads.sourceforge.net/solarm ... irror=osdn
it is MS VS 7 project, but this is not needed for you. you need only all .h and .cpp files. if you will get executable file after compilation in any case you will need dat-files and IrrLicht' dll ( .so for linux i guess ). dat-files -- you can get from binary-zip.

a very little guide:
1) first of all remove "include windows.h" from GameGlobals.h -- this is global include file ( all files in the project includes only this 1 file and nothing more -- so if you will change it -- you will remove it from all the project );
2) next, you will get couple of errors, most of it because of:
- i creating window using Windows functions;
- i switching to fullscreen using Windows functions ( code is not used in SolarModel but it is present in GameCore.cpp -- this code can be removed from source );
- mouse hiding -- made through winapi;
- exiting app i do through winapi too ( because i don't know how do it through IrrLicht );
- also i used HWND, LPARAM, WPARAM -- this is MS specific types :)
3) to use opengl driver, change GameMain.cpp ( GameSetup() function )
...
maybe will be some more problems, BUT

(( now time for good news :) ))
ALL problems will be only in 2 files, it is GameCore.cpp/h and GameMain.cpp/h ( 10 kb in sum ) -- all other files do not uses any Windows' stuff.

----
p.s.: if you get any problems -- ask :)

p.s.s.: there is "wine" ( and "cenega" ( or something sounds like that ) ) for linux -- windows emulators, may be it is faster way to execute it under linux (?)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I know wine (that's why I wrote about it in my last post :wink: ) but my version is pretty old and does not support DirectX rendering.
I'll try the source code. Why do you create the window on your own?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, it was somewhat more work. I removed all windows windows stuff and fixed the headers. But also _strupr i Windows only :cry: So I hd to change all these things to stringc. But hey, I got it finally to work :D
Looks really cool! The textures are nice, the whole setup is really terrific. Only the light is a little low, the outer planets are mostly black. Maybe the ambient light is too dark?
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

hybrid,
indeed i guess in space far far away ( near Pluto ) it is very dark. also if saying truly than dark part of any planet ( back side, that is hidden from the Sun ) must be totally black, because in space there is no any other light emitters..... but i made very very dark ( not totally black ).

any way, if you want to force Sun to emit light for bigger radius -- you can simply edit map.dat file --> find "Radius 1000" and set it to "Radius 2000" for example :)

--------

indeed as you could see most part of source -- is simple map loading. so it can be used in another projects ( as i plaining ). in ideal GameCore.cpp/h -- should only be the place for OS dependent code.

--------

i didn't created window thought IrrLicht because i didn't found any possibility to get HWND of created window -- that is half of the problem... the most problem is that i do not have ability to write my own WindowProc() -- as i new to IrrLicht, i afraid that i will not be able to get some messages ( for example like mouse-scroll , etc. -- that is just an example ). so if i can handle windowproc() -- i can handle any event i possibly will need in future ---------- possibly i am paranoic.... because for now IrrLicht got all ok.

.... any way, i still do not know how to replace SendMessage( HWND, WM_CLOSE, 0 ) -- on IrrLicht style.
i used it on ESC pressing and "EXIT" pressing.
how to send to my window event like "please, close" ?

-------

about textures.
indeed i have more detailed textures for some planets.
for Earth i have 2500x1250 ( i redused it to 2048x1024 )
for all other planets/satellites i used 512x256 ( but most of them i have 1440x720... Moon - 2500x1250 etc. )
with all detailed textures ( detailed so far as i have ) ZIP would be 20Mb+ large. so i decided to leave only Earth detailed enought.... besided Earth has clouds..... so Earth is the best detailed :lol:

... texture of the Sun i made by myself :)

anyway if someone wants very detailed textures -- google it and place in right place in media.dat ( it is ordinal ZIP archive ).

............
besides, why DirectX9, and not OpenGL renderer ?
because i found that my OpenGL doesn't works with very large textures.. for example texture on Earth is not shows at all ( it is 2048x1024 ).... textures up to 1024 -- shows OK. DirectX shows 2048x1024 very ok ( as you can see on screenshot ) ---------- this all is very strange for me, because i have GeForce 6600 GT ( AGP8x ).... strange.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you want to include this app in another one you should extract the window creation code into a separate file. If you need the HWND for some event hadnling you can query the driver for the ExposedVideoData. You can check what to do for window close handling in the examples of the SDK. Simple window closing can easily be handled by Irrlicht.
You should start reading about the Irrlicht core classes. There are general helper classes such as matrix4 and stringc. stringc is really useful for OS independent string handling. The char* functions are not easily portable in some cases and easily introduces buffer overflows.
The texture problem might be due to gfx card driver problems. Check if there are newer ones.
The earth texturing is really nice. The additional clouds layer is awesome.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

You can only see Saturn's rings from one side ;)
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Looks nice :)
could use an asteroid belt
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

monkeycracks wrote:You can only see Saturn's rings from one side ;)
that is not true. to ensure -- just speed up time ( press "4" ) and wait when another side of Saturn's disk will receive Sun's light.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

Ah, you're right. I was looking at the dark/more transparent side :|
My bad :D
CmdKewin
Posts: 29
Joined: Thu Aug 17, 2006 1:49 pm

Post by CmdKewin »

greenya wrote:
CmdKewin wrote:... Real-life relative sizes...
This is impossible to implement. I mean this is impossible to implement to stay project interesting -- it is because indeed:
- planets so far from each other;
- planets very very small relatively to distances;
- the Sun is very big relatively to all other planet sizes; ( for example if we want to get real-life relative -- when the Sun shows on all the screen, Earth will become just a 1 pixel of the screen ( indeed even less then 1 pixel ) );
"Relative" is the key word... :) You set up a scale factor, let's say 1.0 and base all your calculations on this number. Here is an example of what we used:

EarthOrbit=1.0;
EarthRotation = EarthOrbit*365.25636;
EarthAOrbit=EarthOrbit; /* Axis Orbit */
EarthARotation=EarthRotation * -0.5; /* Axis Rotation */
SunRotation=EarthRotation/20.0;
MoonOrbit = EarthRotation/27.321582;
MoonRotation = MoonOrbit;
MarsOrbit = EarthOrbit/1.88081578;
MarsRotation=EarthRotation/1.0274907;
MercuryOrbit = EarthOrbit/0.2408445;
MercuryRotation=EarthRotation/58.6462;

...

o_Mars.id=103;
o_Mars.x=0.0f;
o_Mars.y=0.0f;
o_Mars.z=0.0f;
o_Mars.orbit_angle=0.0f;
o_Mars.width=o_Earth.width*0.532;
o_Mars.height=o_Mars.width;
o_Mars.e = 0.0934f;
o_Mars.a = o_Earth.a*1.523691; o_Mars.distance=o_Mars.a*(1-o_Mars.e*o_Mars.e)/(1-o_Mars.e*cos(o_Mars.orbit_angle));

Code: Select all

void MarsSys()
{
	GLfloat phi;
  	   
   //Coordinates
	o_Mars.orbit_angle = MarsOrbit * (M_PI/180.0);			  
	o_Mars.distance=o_Mars.a*(1-o_Mars.e*o_Mars.e)/(1-o_Mars.e*cos(o_Mars.orbit_angle));
	phi = M_PI/2.0-o_Mars.teta*M_PI/180.0;
  	o_Mars.x = o_Mars.distance*cos(o_Mars.orbit_angle)*sin(phi);
    o_Mars.y = o_Mars.distance*cos(o_Mars.orbit_angle)*cos(phi);
    o_Mars.z = -o_Mars.distance*sin(o_Mars.orbit_angle)*sin(phi);
	 	 
	glPushMatrix();      		
	glPushName(o_Mars.id);
 	glRotated(o_Mars.teta,0.0,0.0,1.0);			//inclina il piano orbitale	    
	glRotated(MarsOrbit, 0.0, 1.0, 0.0);
    glTranslatef(o_Mars.distance,0.0,0.0);		
    glPushMatrix();
    glRotated(-MarsOrbit, 0.0, 1.0, 0.0);	//elimina la rotazione orbitale
    glRotated(-25.19, 0.0, 0.0, 1.0);		//inclina l'asse di rotazione
    glRotated(MarsRotation, 0.0, 1.0, 0.0); 
    
 	if(show_orbits==1)							//disegna gli assi
	{
        glDisable(GL_LIGHTING);          
    	glDisable(GL_TEXTURE_2D);
        glColor3f(1.0,0.0,1.0);    
	    glBegin(GL_LINES);	
    		glVertex3f(0, -1, 0);
    		glVertex3f(0, 1, 0);    										
   		glEnd();
	    glBegin(GL_LINES);	
    		glVertex3f(-1, 0, 0);
    		glVertex3f(1, 0, 0);
      	glEnd();  	
        glEnable(GL_TEXTURE_2D);				
        glEnable(GL_LIGHTING);
    }  
                        
    glRotated(-90.0,1.0,.0,0.0);            
    glBindTexture(GL_TEXTURE_2D, texture[6].texID); 
    gluSphere(quadratic,o_Mars.width,50,50);
    glPopMatrix();  
    glPopName();   
    glPopMatrix();    
}    

void MercurySys()
{
	GLfloat phi;
  	   
   //Coordinates
	o_Mercury.orbit_angle = MercuryOrbit * (M_PI/180.0);			  
	o_Mercury.distance=o_Mercury.a*(1-o_Mercury.e*o_Mercury.e)/(1-o_Mercury.e*cos(o_Mercury.orbit_angle));
	phi = M_PI/2.0-o_Mercury.teta*M_PI/180.0;
  	o_Mercury.x = o_Mercury.distance*cos(o_Mercury.orbit_angle)*sin(phi);
    o_Mercury.y = o_Mercury.distance*cos(o_Mercury.orbit_angle)*cos(phi);
    o_Mercury.z = -o_Mercury.distance*sin(o_Mercury.orbit_angle)*sin(phi);
	 	 
	glPushMatrix();      		
	glPushName(o_Mercury.id);    
    glRotated(o_Mercury.teta,0.0,0.0,1.0);				//inclina il piano orbitale	
	glRotated(MercuryOrbit, 0.0, 1.0, 0.0);
    glTranslatef(o_Mercury.distance,0.0,0.0);		
    glPushMatrix();
    glRotated(-MercuryOrbit, 0.0, 1.0, 0.0);			//elimina la rotazione orbitale
    glRotated(-0.1, 0.0, 0.0, 1.0);						//inclina l'asse di rotazione

    glRotated(MercuryRotation, 0.0, 1.0, 0.0);
 	if(show_orbits==1)									//disegna gli assi
	{
        glDisable(GL_LIGHTING);          
    	glDisable(GL_TEXTURE_2D);
        glColor3f(1.0,0.0,1.0);    
	    glBegin(GL_LINES);	
    		glVertex3f(0, -1, 0);
    		glVertex3f(0, 1, 0);    										
   		glEnd();	
	    glBegin(GL_LINES);	
    		glVertex3f(-1, 0, 0);
    		glVertex3f(1, 0, 0);    										
   		glEnd();
        glEnable(GL_TEXTURE_2D);				
        glEnable(GL_LIGHTING);
    }                        
    glRotated(-90.0,1.0,.0,0.0);            
    glBindTexture(GL_TEXTURE_2D, texture[9].texID); 
    gluSphere(quadratic,o_Mercury.width,50,50);
    glPopMatrix();  
    glPopName();   
    glPopMatrix();     
}
And so on. :) Get the idea? That data is based on actual values, you can find them in any Physics Formulary.

As you can see from the below image, results are acceptable.


Image
greenya wrote: that is why only planet order ( from Sun to Pluto is real ) , and relative size between planets real in some meaning ( i mean if Jupiter bigger than Earth -- it is very easy to determinate, BUT you will never guess by your eyes that Jupiter is 15 times bigger of Earth ).
Tell that to the Celestia guys :D

p.s. If you want an executable, PM me. You can see for yourself :)
p.s.s: Yes, we ARE crazy. Guess than having the best grade possible in 3D Graphics is more than satisfactory ;)
Post Reply