Statistics | We have 1675 registered users The newest registered user is dejo123
Our users have posted a total of 30851 messages in 1411 subjects
|
Who is online? | In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests None Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm |
Latest topics | » THIS FORUM IS NOW OBSOLETE by NickTheNick Sat Sep 26, 2015 10:26 pm
» To all the people who come here looking for thrive. by NickTheNick Sat Sep 26, 2015 10:22 pm
» Build Error Code::Blocks / CMake by crovea Tue Jul 28, 2015 5:28 pm
» Hello! I can translate in japanese by tjwhale Thu Jul 02, 2015 7:23 pm
» On Leave (Offline thread) by NickTheNick Wed Jul 01, 2015 12:20 am
» Devblog #14: A Brave New Forum by NickTheNick Mon Jun 29, 2015 4:49 am
» Application for Programmer by crovea Fri Jun 26, 2015 11:14 am
» Re-Reapplication by The Creator Thu Jun 25, 2015 10:57 pm
» Application (programming) by crovea Tue Jun 23, 2015 8:00 am
» Achieving Sapience by MitochondriaBox Sun Jun 21, 2015 7:03 pm
» Microbe Stage GDD by tjwhale Sat Jun 20, 2015 3:44 pm
» Application for Programmer/ Theorist by tjwhale Wed Jun 17, 2015 9:56 am
» Application for a 3D Modeler. by Kaiju4u Wed Jun 10, 2015 11:16 am
» Presentation by Othithu Tue Jun 02, 2015 10:38 am
» Application of Sorts by crovea Sun May 31, 2015 5:06 pm
» want to contribute by Renzope Sun May 31, 2015 12:58 pm
» Music List Thread (Post New Themes Here) by Oliveriver Thu May 28, 2015 1:06 pm
» Application: English-Spanish translator by Renzope Tue May 26, 2015 1:53 pm
» Want to be promoter or project manager by TheBudderBros Sun May 24, 2015 9:00 pm
» A new round of Forum Revamps! by Oliveriver Wed May 20, 2015 11:32 am
|
|
| Gravitation System Simulator | |
| | Author | Message |
---|
Daniferrito Experienced
Posts : 726 Reputation : 70 Join date : 2012-10-10 Age : 30 Location : Spain
| Subject: Gravitation System Simulator Fri Nov 02, 2012 4:06 pm | |
| Here i leave you a linux version of a gravitation system simulator i made a few weeks ago on Ogre. The code is a bit messy because my eclipse keeps telling me every single line i write is wrong, even through it compiles and runs well. I believe it only works on a linux with a 64x processor (i will try to build it in my 32x laptop soon). Application: v0.1 (Linux 64x) v0.2 (win32) The application should be inside the bin folder, called OgreApp. Just choose a renderer and click accept. arrows to move, mouse to look around and mayus to speed up. Screenshots: - Spoiler:
Here are how the planets start, from left to right, Sun, Mercury, Venus, Earth (with the moon on the side, it's hard to see from so far), Mars and Jupiter (wich looks much smaller than it really is because it is really far away) Here you can see the earth with the moon at its side, and mars and jupiter behind them (you can't see saturn and so on because they are not big enough to fill one pixel). You can tell what it is because the part of the earth you see is the bright side, and so the back side faces away from the sun Here you can see the gravitation system after about 2 in-game months (25s). The planet on the right is Venus, as mercury is too small to fill a pixel Here you can see Earth, the Moon, Mercury and Venus Here you can see the earth and two moons!! The second moon is rotating from one of earth poles to the other, instead of folowing the equator as the normal moon does. It quickly interferes with the other and both are lost. As you can see the planets dont have any kind of texture on it, they are just white spheres. At least they have shadows (Althrough they dont project shadows over other objects). First version used Ogreheads as planets
Sourcecode: v0.1 v0.2 Description of sources: - Spoiler:
Folder dist: all the resources needed by the code (loke the graphics for the menu)
BaseApplication.h-cpp: This is just a copy from the Ogre tutorial framework, i didnt change anything here. TutorialAplication.cpp: This file creates the scene, and updates the position of all the planets on every frame (i wanted to do it on a separate thread, updating every 50ms, but i wasn't able to) TutorialAplication.h: Basicaly this adds two things: initializeGravitationSystem, which creates a vector of objects with its caracteristics hardcoded, and createSphere, which creates a sphere mesh, so i dont have to use ogre heads. Object.h: This adds all the methods that the Object object needs, like all the getters and setters, incrementaPos, which updates the position and distanca, which returns the distance between two objects. Object.cpp: Just the constructor
The code is actually a mess, with some comments and functions being in spanish. It should be understandabe, but i will change it as soon as i can.
As soon as i can, i will update this post with a new version, hopefully much better code-wise (as i started to fix my eclipse so it doesent say every line is wrong) EDIT: I added a new source version, this time with full comments (And they are in english too!!). I added the third axis too, so now there can be stranger things (see fifth picture) I am using Microsoft Visual studio, which means a windows port is much closer, but i still can't produce any working exe. EDIT2: There you go, a working version on windows. In this one i left the two moons, wich means that the earth loses both its moons after only a few earth days. Special thanks to doggit for its help testing.
Last edited by Daniferrito on Sun Nov 04, 2012 8:42 am; edited 2 times in total | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Gravitation System Simulator Fri Nov 02, 2012 6:27 pm | |
| Right off the bat, I would like to applaud you for creating something. The last prototype that came out that I can remember was Seregon's cell resource tracker. I love it when these come out. Really great work here, I gave you points for that.
From the screenshots it looks great, but I had trouble finding a program to run it with. Do you have any suggestion?
Last edited by NickTheNick on Fri Nov 02, 2012 6:37 pm; edited 1 time in total | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Gravitation System Simulator Fri Nov 02, 2012 7:01 pm | |
| Nice work, as Nick says, presenting anything working is useful right now. Looking at your introduction thread, you mentioned making a gravity sim before, but had no Ogre experience, did you translate this from your previous project?
It won't run on windows, as it's only been compiled for linux (the OgreApp file isn't a file to be opened, it's a program to be run). Looking at the code though, I can't see any obvious reason it shouldn't compile for windows too, though doing so isn't necessarily trivial.
I'll be running through the ogre tutorials sometime soon, and will be doing so primarily for windows, so should be able to compare the two. Having a working linux example should really help there.
Finaly, on the topic of prototypes, I really should release a few more... I had a much improved version of the compound tracker almost done months ago, but had to shelve it to coordinate other things. | |
| | | Daniferrito Experienced
Posts : 726 Reputation : 70 Join date : 2012-10-10 Age : 30 Location : Spain
| Subject: Re: Gravitation System Simulator Fri Nov 02, 2012 7:33 pm | |
| - NickTheNick wrote:
- Right off the bat, I would like to applaud you for creating something. The last prototype that came out that I can remember was Seregon's cell resource tracker. I love it when these come out. Really great work here, I gave you points for that.
From the screenshots it looks great, but I had trouble finding a program to run it with. Do you have any suggestion? Thanks! About running it, as i said (and seregon pointed out), it's only compiled for linux. My code would be the same, i dont think it needs any adaptation, but i need a working windows compiler in order to make it executable for windows. I should have a 32 bits for linux tomorrow, maybe sunday, if my laptop decides to behave well. Anyone feel free compile it for windows. - Seregon wrote:
- Nice work, as Nick says, presenting anything working is useful right now. Looking at your introduction thread, you mentioned making a gravity sim before, but had no Ogre experience, did you translate this from your previous project?
It won't run on windows, as it's only been compiled for linux (the OgreApp file isn't a file to be opened, it's a program to be run). Looking at the code though, I can't see any obvious reason it shouldn't compile for windows too, though doing so isn't necessarily trivial.
I'll be running through the ogre tutorials sometime soon, and will be doing so primarily for windows, so should be able to compare the two. Having a working linux example should really help there.
Finaly, on the topic of prototypes, I really should release a few more... I had a much improved version of the compound tracker almost done months ago, but had to shelve it to coordinate other things. Yes, this code is nearly all from my other gravity sim, i just translated it from Java. It actually took me one week to give up on developing on windows, a weekend preparing and learning basic ogre and just a few hours translating everything over (actually was a few hours understaunding how objects work in c++, 5 minutes for ctrl-c, ctrl-v and 10 minutes fixing the things that on c++ and java are different) The code should be the same. if you look at the CMakeLists.txt, which tells CMake how to compile it, it is prepared to run on nearly any plattform. | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Gravitation System Simulator Fri Nov 02, 2012 7:49 pm | |
| Wow I feel very foolish now for overlooking that. Nonetheless, great work. Hopefully we will hear from the other programmers sometime too. | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Gravitation System Simulator Sat Nov 03, 2012 8:37 am | |
| I'll have a go at compiling this for windows at some point, but I'm not very familiar with using cmake, so it may take some time. I'll be starting the ogre tutorials at a some point today, so will have a look at how the windows and linux compilation differs.
Apart from that, the code looks reasonable actually, though it could use quite a few more comments! | |
| | | Daniferrito Experienced
Posts : 726 Reputation : 70 Join date : 2012-10-10 Age : 30 Location : Spain
| Subject: Re: Gravitation System Simulator Sat Nov 03, 2012 11:10 am | |
| OK, v0.2 is out. I got it working in windows, but only if i run it through Microsoft Visual Studio. I will look how to generate an exe. I also added the third axis and cleaned up most of the code, as it was huge mess. Now it shoud be much easier to understaund. | |
| | | Doggit Regular
Posts : 444 Reputation : 36 Join date : 2012-04-28
| Subject: Re: Gravitation System Simulator Sat Nov 03, 2012 12:49 pm | |
| - Daniferrito wrote:
- Here i leave you a linux version of a gravitation system simulator i made a few weeks ago on Ogre. The code is a bit messy because my eclipse keeps telling me every single line i write is wrong, even through it compiles and runs well. I believe it only works on a linux with a 64x processor (i will try to build it in my 32x laptop soon).
Application:
Download link (64x) The application should be inside the bin folder, called OgreApp. Just choose a renderer and click accept. arrows to move, mouse to look around and mayus to speed up
Screenshots:
- Spoiler:
Here are how the planets start, from left to right, Sun, Mercury, Venus, Earth (with the moon on the side, it's hard to see from so far), Mars and Jupiter (wich looks much smaller than it really is because it is really far away) Here you can see the earth with the moon at its side, and mars and jupiter behind them (you can't see saturn and so on because they are not big enough to fill one pixel). You can tell what it is because the part of the earth you see is the bright side, and so the back side faces away from the sun Here you can see the gravitation system after about 2 in-game months (25s). The planet on the right is Venus, as mercury is too small to fill a pixel Here you can see Earth, the Moon, Mercury and Venus Here you can see the earth and two moons!! The second moon is rotating from one of earth poles to the other, instead of folowing the equator as the normal moon does. It quickly interferes with the other and both are lost. As you can see the planets dont have any kind of texture on it, they are just white spheres. At least they have shadows (Althrough they dont project shadows over other objects). First version used Ogreheads as planets
Sourcecode:
v0.1 v0.2
Description of sources:
- Spoiler:
Folder dist: all the resources needed by the code (loke the graphics for the menu)
BaseApplication.h-cpp: This is just a copy from the Ogre tutorial framework, i didnt change anything here. TutorialAplication.cpp: This file creates the scene, and updates the position of all the planets on every frame (i wanted to do it on a separate thread, updating every 50ms, but i wasn't able to) TutorialAplication.h: Basicaly this adds two things: initializeGravitationSystem, which creates a vector of objects with its caracteristics hardcoded, and createSphere, which creates a sphere mesh, so i dont have to use ogre heads. Object.h: This adds all the methods that the Object object needs, like all the getters and setters, incrementaPos, which updates the position and distanca, which returns the distance between two objects. Object.cpp: Just the constructor
The code is actually a mess, with some comments and functions being in spanish. It should be understandabe, but i will change it as soon as i can.
As soon as i can, i will update this post with a new version, hopefully much better code-wise (as i started to fix my eclipse so it doesent say every line is wrong)
EDIT: I added a new source version, this time with full comments (And they are in english too!!). I added the third axis too, so now there can be stranger things (see fifth picture) I am using Microsoft Visual studio, which means a windows port is much closer, but i still can't produce any working exe. great work! | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Gravitation System Simulator Sat Nov 03, 2012 9:01 pm | |
| Ok, so much for having a go at the ogre tuts today, getting to the point of even compiling an ogre app is an absolute nightmare... I feel like I've spent the last 5 hours smacking my head against my desk!
That's not to say ogre is at fault, really. Rather, its my choice of developing in eclipse cdt, while compiling via mingw/msys, and my complete lack of familiarity with any of the above, or cmake. I've also lost count of how many times I've had to add or change an environment variable...
That being said, I am getting incrementally closer to actually compiling something (namely the tutorial framework mentioned above)...
update - several hours later, still not working. I now seem to have fixed most of my previous problems, the only one left is trying to get boost and mingw to play nicely together.
Last edited by Seregon on Sat Nov 03, 2012 10:58 pm; edited 1 time in total | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Gravitation System Simulator Sat Nov 03, 2012 10:18 pm | |
| Any effort is valuable effort Seregon. I am really glad to hear you working on Ogre. From what little I know of the current programming situation, understanding Ogre is one of the biggest hurdles. Just remember that we are all behind you on this. If you need any help, I'm sure we would be willing to help.
I can't wait, you are really doing well here! | |
| | | Daniferrito Experienced
Posts : 726 Reputation : 70 Join date : 2012-10-10 Age : 30 Location : Spain
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 8:36 am | |
| Ok, i got the v0.2 working on windows. The upload link should be in the main post, but here is goes in case i havent got time to edit it yet.
G-POC-v0.2
It is for windows x32, but it should run fine on x64 (It runs fine on mine at least)
Special thanks to Doggit for the testing. | |
| | | Seregon Regular
Posts : 263 Reputation : 37 Join date : 2011-08-10 Location : UK
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 1:16 pm | |
| ...it works
It only took me 2 days (about 19 hours straight), kept me up until 4am last night, and involved reading about 100 different websites for help, but I finally got it working. And by 'it', I mean the tutorial framework... a big, black, blank fullscreen app which does absolutely nothing, but atleast it's not an error message.
Getting that to compile and run via mingw/eclipse is probably the single hardest thing I've ever done on a computer, but it's done now, so I can finally start the tutorials! It also makes me realise why so few games are crossplatform, had we been targetting only windows I'd have been up and running in about 30 minutes.
Right now though, I need food and water, so I'll come back to this in a few hours time. | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 2:18 pm | |
| It's great to hear that Seregon. Good luck with the tutorials.
Daniferrito: I can't open it because my Norton Security program keeps removing the .exe since it says it is dangerous. | |
| | | ~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 3:56 pm | |
| Hey guys, I'm not dead. That file's a bit intimidating though, so I won't dabble with it. I'm happy to know that things are moving. | |
| | | Daniferrito Experienced
Posts : 726 Reputation : 70 Join date : 2012-10-10 Age : 30 Location : Spain
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 4:09 pm | |
| - NickTheNick wrote:
- It's great to hear that Seregon. Good luck with the tutorials.
Daniferrito: I can't open it because my Norton Security program keeps removing the .exe since it says it is dangerous. It shouldnt be doing that. I passed the file over to Doggit and it ran fine in his computer. I downloaded it back, the first time i ran it my computer froze when i closed it, but it seem alright now, not sure if it was related. | |
| | | NickTheNick Overall Team Co-Lead
Posts : 2312 Reputation : 175 Join date : 2012-07-22 Age : 28 Location : Canada
| Subject: Re: Gravitation System Simulator Sun Nov 04, 2012 8:37 pm | |
| It still doesn't work, I tried it on another computer that Norton wasn't installed on, and it said that:
"This application has failed to start because MSVCP100.dll was not found. Re-installing the application may fix this problem."
I tried reinstalling, didn't work. However, if I am the only one with this problem, I don't want to deviate the course of this thread.
EDIT: I solved the problem by installing a Microsoft C++ program, but now when try to run it it just says that a different file is missing. | |
| | | Sponsored content
| Subject: Re: Gravitation System Simulator | |
| |
| | | | Gravitation System Simulator | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |