• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:13
CEST 12:13
KST 19:13
  • 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
ByuL, and the Limitations of Standard Play1Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8
Community News
[TLMC] Summer 2026 Ladder Map Rotation05.0.16 patch for SC2 goes live (8 worker start)83ZeroSpace at Steam NextFest - Last free demo38Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611
StarCraft 2
General
Is the larve respawn broken? The Death of Cheese: From a Professional Cheeser 5.0.16 patch for SC2 goes live (8 worker start) Old Replays From 1.4.6 The future of the SC game model
Tourneys
Douyu Cup 2026: $20,000 Legends Event (June 26-28) Maestros of The Game 2 announcement and schedule ! RSL Revival: Season 6 - Qualifiers and Main Event INu's Battles#17 <BO.9> Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 532 Nuclear Family Mutation # 531 Experimental Artillery Mutation # 530 One For All
Brood War
General
ASL 22 Proposed Map Pool ProGamer Paychecks Story Best thing happen to StarCraft since Remastered? Data needed BW General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL21] Grand Finals The Casual Games of the Week Thread [BSL22] GosuLeague Casts - Tue & Thu 22:00 CEST
Strategy
Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies Why doesn't anyone use restoration?
Other Games
General Games
ZeroSpace at Steam NextFest - Last free demo Path of Exile Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason
Dota 2
Looking for a Dota Mentor 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
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
The Games Industry And ATVI US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Listen To The Coaches!
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6726 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 47m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech144
Lowko22
StarCraft: Brood War
Calm 3801
Leta 1495
Sea 1163
BeSt 627
Aegong 461
Hyuk 382
Mini 305
Mong 228
Larva 180
Soma 127
[ Show more ]
Soulkey 103
Jaedong 64
Rush 62
Pusan 62
Killer 49
EffOrt 45
hero 38
ToSsGirL 31
yabsab 20
sorry 16
Bale 13
Hm[arnc] 10
Noble 8
Sacsri 8
HiyA 7
IntoTheRainbow 5
[sc1f]eonzerg 1
Light 0
League of Legends
JimRising 465
Counter-Strike
olofmeister1713
shoxiejesuss868
markeloff145
kRYSTAL_18
Super Smash Bros
Mew2King94
Other Games
Pyrionflax232
crisheroes231
BEARDiaguz17
Organizations
Dota 2
PGL Dota 2 - Main Stream249
StarCraft: Brood War
lovetv 10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• LUISG 31
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 8
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV333
League of Legends
• Jankos2454
Upcoming Events
WardiTV Weekly
47m
RSL Revival
23h 47m
RSL Revival
1d 6h
Bombastic Starleague
1d 9h
Kung Fu Cup
2 days
OSC
2 days
CrankTV Team League
3 days
Bombastic Starleague
3 days
Replay Cast
3 days
The PondCast
3 days
[ Show More ]
HomeStory Cup
4 days
Replay Cast
4 days
HomeStory Cup
5 days
Replay Cast
5 days
HomeStory Cup
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

BSL 22 Non-Korean Championship
Douyu Cup 2026
Murky Cup 2026

Ongoing

IPSL Spring 2026
Acropolis #4
CSCL: Masked Kings S4
YSL S3
CSL Season 21: Qualifier 2
SCTL 2026 Spring
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026

Upcoming

CSL 2026 Summer (S21)
ASL Season 22:Wild Card Qualifier
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
BCC 2026
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E1
Heroes Pulsing #3
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 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.