• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:50
CET 17:50
KST 01:50
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Behind the Blue - Team Liquid History Book9Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info6herO wins SC2 All-Star Invitational14
Community News
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)9Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win2RSL Season 4 announced for March-April7Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0
StarCraft 2
General
Behind the Blue - Team Liquid History Book How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Rongyi Cup S3 - Preview & Info Clem wins HomeStory Cup 28 HomeStory Cup 28 - Info & Preview
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) WardiTV Mondays $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) Sparkling Tuna Cup - Weekly Open Tournament $5,000 WardiTV Winter Championship 2026
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 512 Overclocked The PondCast: SC2 News & Results Mutation # 511 Temple of Rebirth Mutation # 510 Safety Violation
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ [ASL21] Potential Map Candidates Gypsy to Korea BW General Discussion Liquipedia.net NEEDS editors for Brood War
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
ZeroSpace Megathread Diablo 2 thread Battle Aces/David Kim RTS Megathread EVE Corporation Nintendo Switch Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
Play, Watch, Drink: Esports …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1695 users

[Programming] Quadrotor Physics Simulator

Blogs > Abraxas514
Post a Reply
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
Last Edited: 2012-10-11 16:33:10
October 11 2012 13:56 GMT
#1
Hello TL!

For my 4th year (last year here in Quebec) I'm working on a big project called "Capstone" which I think most north american universities require their eng students to complete before graduation.

Since I'm in Mech, I'm actually going to BUILD this thing, but as a good little engineer I need to prove to my supervising professor I'm not an ass and actually know this thing can work. So, instead of using SolidWorks or working model, I just programmed in straight in C++/Irrlicht!

Here are some screens:


[image loading]
[image loading][image loading]

Here is the executable:

Capstone quadrotor simulator project

Please test it out, the readme should be plenty helpful.

Let me know if you see any issues with the physics or controls, and if you have any graphical advice. My knowledge of sciences in order of magnitude goes PHYSICS+MATH>>>>>>>programming>>>>>>>>graphics so go easy on me

Thanks!

PS: let me know what your FPS is! if it's below 100, please provide PC specs

Fear is the mind killer
frogmelter
Profile Blog Joined April 2009
United States971 Posts
October 11 2012 17:04 GMT
#2
Weird chrome is providing a suspicious file alert....
TL+ Member
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
October 11 2012 18:33 GMT
#3
Nice work! 3d engine with textures and collision detection! Being able to program while also do the mechanical design makes you a prime candidate for modern engineering jobs. Did you open source this?
Any sufficiently advanced technology is indistinguishable from magic
CoughingHydra
Profile Blog Joined May 2012
177 Posts
October 11 2012 18:57 GMT
#4
How do you detect collisions between objects?
Recognizable
Profile Blog Joined December 2011
Netherlands1552 Posts
October 11 2012 19:14 GMT
#5
Wait, for your final year in univeristy you are going to build that cross chopper thingy? Kids in my class want to do that for their exam year, in high school. I already expected them to fail hard, but now I don't even think they stand a chance haha.
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
October 11 2012 23:19 GMT
#6
On October 12 2012 03:33 RoyGBiv_13 wrote:
Nice work! 3d engine with textures and collision detection! Being able to program while also do the mechanical design makes you a prime candidate for modern engineering jobs. Did you open source this?


Didn't open source yet because it's part of my capstone project and I need to keep it as such until the project is complete. Thanks for the comment!

On October 12 2012 03:57 CoughingHydra wrote:
How do you detect collisions between objects?


The following technique works best. You save an array of all the tris of all the models you want to test collision with. You then perform a direction + velocity test against each tri in "collision distance". If your line intersects, you use those parameters to determine the output. I just directly subtracted a fraction of the velocity dot producted onto the normal of the triangle.

On October 12 2012 04:14 Recognizable wrote:
Wait, for your final year in univeristy you are going to build that cross chopper thingy? Kids in my class want to do that for their exam year, in high school. I already expected them to fail hard, but now I don't even think they stand a chance haha.


It's a quadrotor. And there is no way a highschooler can build this without using a flight controller, because the control sequences need physics analysis to compute. You need to have studied Statics, Dynamics, Mechanics of Materials, Control systems 1 (at least), Fluid dynamics and also all the math: differential equations, vector calculus and transform calculus... to program the flight controller.

It sounds like they want to buy one of these:
http://www.hobbyking.com/hobbyking/store/__592__501__Multi_Rotors_Parts-RTF_PNF_ARF.html
and put it together. Good for them, every engineer needs to start somewhere.




BTW if one of the DLLs are giving you errors, just delete it. I included them for redundancy but forgot to give instructions.
Fear is the mind killer
Ssin
Profile Blog Joined August 2010
United States88 Posts
October 12 2012 03:56 GMT
#7
This is very cool, and I will be sure to play around with it. Physics and math are really fun, and when you mix it with programming you can do all kinds of interesting experiments.

Hope it all works out for you!
DarkwindHK
Profile Blog Joined April 2010
Hong Kong343 Posts
October 12 2012 04:05 GMT
#8
man this is really a great work. I study physics in my bachelor degree and I really do not know any programming; just the math and physics you need to know to program will take years to master!

With 4 rotors there is a lot of calculation going on and they all affect each other and the angle of the Quadrotor itself......
Dont be too humble, you are not that great.
Abraxas514
Profile Blog Joined May 2010
Canada475 Posts
Last Edited: 2012-10-13 17:18:40
October 13 2012 17:18 GMT
#9
On October 12 2012 13:05 DarkwindHK wrote:
man this is really a great work. I study physics in my bachelor degree and I really do not know any programming; just the math and physics you need to know to program will take years to master!

With 4 rotors there is a lot of calculation going on and they all affect each other and the angle of the Quadrotor itself......


Here is an excerpt from my control systems code, well commented as a mark of a good programmer




//***** FORCE AND ANGLE OUTPUT CONTROL*****//

// Here is the actual control system.
// First we need to figure out how much force in the Y do we need to balance:
f32 yforce[5] = {0, (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5), (vbalance + vycorrecttion * .5)} ;

//Next we adjust yforces for losses while rolling and pitching:
f32 lossfactor = abs(cos(plane.theta.XEGTORAD)) * abs(cos(plane.theta.ZEGTORAD));

yforce[1] /= lossfactor; yforce[2] /= lossfactor;
yforce[3] /= lossfactor; yforce[4] /= lossfactor;

// Next we add/subtract some force to produce roll
yforce[1] -= rollcorrection * rollcf ; yforce[3] -= rollcorrection* rollcf ;
yforce[2] += rollcorrection * rollcf ; yforce[4] += rollcorrection* rollcf ;

// Next we add/subtract some force to produce pitch
yforce[1] += pitchcorrection * pitchcf; yforce[2] += pitchcorrection * pitchcf;
yforce[3] -= pitchcorrection * pitchcf; yforce[4] -= pitchcorrection * pitchcf;


// Next we change diagonal forces to produce yaw
yforce[1] += yawcorrection * yawcf; yforce[4] += yawcorrection * yawcf;
yforce[2] -= yawcorrection * yawcf; yforce[3] -= yawcorrection * yawcf;


// Next we figure out how big our actual force output must be:
f32 totalforce[5] = {0, yforce[1] / cos(plane.f[1].theta), yforce[2] / cos(plane.f[2].theta),yforce[3] / cos(plane.f[3].theta),yforce[4] / cos(plane.f[4].theta)};

//// Increase by speedfactor:
totalforce[1] *= speedfactor; totalforce[2] *= speedfactor;totalforce[3] *= speedfactor;totalforce[4] *= speedfactor;
//
//// Recalculate y:
yforce[1] = totalforce[1]*cos(plane.f[1].theta); yforce[2] = totalforce[2]*cos(plane.f[2].theta);
yforce[3] = totalforce[3]*cos(plane.f[3].theta); yforce[4] = totalforce[4]*cos(plane.f[4].theta);


// Next we assign the X-component:
f32 xforce[5] = {0, totalforce[1] * sin(plane.f[1].theta), totalforce[2] * sin(plane.f[2].theta), totalforce[3] * sin(plane.f[3].theta), totalforce[4] * sin(plane.f[4].theta)};

// Next Assign Z component:

f32 zforce[5] = {0, 0, 0, 0, 0};
Fear is the mind killer
]343[
Profile Blog Joined May 2008
United States10328 Posts
October 13 2012 19:20 GMT
#10
wow, sick! too bad it requires windows T.T (I guess I could try to run it in wine, bleh)
Writer
Please log in or register to reply.
Live Events Refresh
Next event in 10m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 152
StarCraft: Brood War
Calm 3914
Bisu 2702
Flash 1655
firebathero 1260
Larva 1018
EffOrt 505
Mini 494
Hyuk 404
ZerO 351
Soulkey 267
[ Show more ]
actioN 263
Rush 201
ggaemo 170
hero 140
Sharp 109
Mong 87
PianO 56
Backho 54
Bale 50
Mind 48
Bonyth 40
Free 31
Movie 25
Aegong 24
Shuttle 21
Rock 20
soO 15
Shinee 14
JulyZerg 13
sorry 12
Shine 10
Dota 2
Gorgc3562
qojqva2194
Dendi625
420jenkins194
XcaliburYe73
League of Legends
Rex74
Counter-Strike
fl0m742
allub464
adren_tv122
Super Smash Bros
Mew2King150
Other Games
singsing1558
hiko1027
Grubby718
Beastyqt575
FrodaN396
ArmadaUGS240
crisheroes214
Liquid`VortiX147
Hui .121
oskar102
Trikslyr44
ZerO(Twitch)27
MindelVK12
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• LUISG 33
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV361
League of Legends
• TFBlade1381
• Stunt345
• Shiphtur5
Upcoming Events
Monday Night Weeklies
10m
Replay Cast
7h 10m
Sparkling Tuna Cup
17h 10m
LiuLi Cup
18h 10m
Reynor vs Creator
Maru vs Lambo
PiGosaur Monday
1d 8h
Replay Cast
1d 16h
LiuLi Cup
1d 18h
Clem vs Rogue
SHIN vs Cyan
The PondCast
2 days
KCM Race Survival
2 days
LiuLi Cup
2 days
Scarlett vs TriGGeR
ByuN vs herO
[ Show More ]
Replay Cast
3 days
Online Event
3 days
LiuLi Cup
3 days
Serral vs Zoun
Cure vs Classic
RSL Revival
4 days
RSL Revival
4 days
LiuLi Cup
4 days
uThermal 2v2 Circuit
4 days
RSL Revival
5 days
Replay Cast
5 days
Sparkling Tuna Cup
5 days
LiuLi Cup
5 days
Replay Cast
6 days
Replay Cast
6 days
LiuLi Cup
6 days
Wardi Open
6 days
Liquipedia Results

Completed

CSL 2025 WINTER (S19)
Rongyi Cup S3
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
LiuLi Cup: 2025 Grand Finals
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.