Loading video...

Video Failed to Load

Go Home

I built a physically based Three.js drifting simulator. Let me explain 👇 #threejs #gamedev

19,576 views • 7 months ago •via X (Twitter)

32 Comments

Alex's profile picture
Alex7 months ago

Making a basic drift behaviour is pretty easy, I explained it several time but here goes the generic -> move the car based on a forward direction inputs rotates the car, the forward direction lerps to the actual car's forward direction, bingo you get an easy drift behaviour !

Alex's profile picture
Alex7 months ago

But i want actual car feel, weight, weight balance shift, car tires, slip drift, etc. And for that we have several option : 1. Rapier, issue : rapier struggles with fast moving objects so you easily miss grips. 2. PhysX Nvidia, issue : poor resources online and unmaintained

Alex's profile picture
Alex7 months ago

But physics engine has one BIG issue with three.js : They act as a black box, it's a bit complicated to understand the slippiness, and what's exactly happening. Only one solution :

Alex's profile picture
Alex7 months ago

So I spent my entire insomnight reading docs, watching videos, understanding how cars works, suspension, acceleration. And I built my own car engine: Here's with a grippy setup. just tweaking values provided the drift simulator

Alex's profile picture
Alex7 months ago

only raycast bvh based

Drift, Race, Build -- Defend you home course's profile picture
Drift, Race, Build -- Defend you home course7 months ago

@threejs looks good! yeah rapier isn't great for three.js vehicle physics, a custom solution is much better. Thats where I ended up too.

Synonymous Arts's profile picture
Synonymous Arts7 months ago

@threejs I tried building it myself here, it was decent. see: demo here:

chosem 😖's profile picture
chosem 😖7 months ago

@threejs never once have i seen basement studio fail at something

Julien Dassonval's profile picture
Julien Dassonval7 months ago

@threejs Wow, that was fast from the moment you mentioned the project. Machine mode 🔥

sumukh's profile picture
sumukh7 months ago

@threejs Woww

David Webster's profile picture
David Webster7 months ago

@threejs hawt

Cortiz's profile picture
Cortiz7 months ago

@threejs It's insane how fast you're progressing with your projects, really cool 👏👏

Alex's profile picture
Alex7 months ago

@threejs From idea to shipping 👁️👁️

Hardik Gupta's profile picture
Hardik Gupta7 months ago

@threejs 🐐🐐🐐🐐🐐🐐🐐🐐🐐🐐🐐🐐🐐

Vincent's profile picture
Vincent7 months ago

@threejs just with three.js? damn it looks amazing!! reminds me of Drift City lol legend 👏🏼

Stéphane - smo's profile picture
Stéphane - smo7 months ago

@threejs t'es un malade et j'avais vu passer une approche avec une sphère à la place de la voiture pour simuler la physique drift. ça aurait été moins intéressant ?

Alex's profile picture
Alex7 months ago

c’est exactement ça, et c’est beaucoup moins intéressant parce que t’as le contrôle. Le principe même du drift pour avoir expérimenté ça un milliers d’heures en simu, c’est de pas avoir le contrôle et de jouer avec ça T’es en contrôle que quand tu maîtrise l’incontrôlable 😂

Stéphane - smo's profile picture
Stéphane - smo7 months ago

@threejs Haha tkt gros amateur de drift et tout en VR

Alex's profile picture
Alex7 months ago

@threejs Voilaaaa

Rayane's profile picture
Rayane7 months ago

@threejs Wow ! Looks good. Btw i saw a plugin for driving game physics, i used the equivalent for my ciws game its jsbsim

Alex's profile picture
Alex7 months ago

@threejs Damn, any live example ?

Sebastien-console_buche 🪵's profile picture
Sebastien-console_buche 🪵7 months ago

@threejs This is so smooth and clean! Well done

Alex's profile picture
Alex7 months ago

@threejs Thanks Seb ! I try too !

Eric's profile picture
Eric7 months ago

@threejs epic

Previous Leon's profile picture
Previous Leon7 months ago

@threejs This looks so good

Nova's profile picture
Nova7 months ago

@threejs This looks amazing

Speraccio's profile picture
Speraccio7 months ago

@threejs Wow so cool! though I do appreciate the craft that goes into getting the drifts right, Inertial Drift has the most dope looking drift animations I can think of

Jos Graas 🇱🇺's profile picture
Jos Graas 🇱🇺7 months ago

@threejs Now enable DLSS5, ans you got a triple A game

Pixel Girl™'s profile picture
Pixel Girl™7 months ago

@threejs NICE!

Amichay Giuili's profile picture
Amichay Giuili7 months ago

@threejs I think the missing piece here is good drift sound effects - wonder how you can integrate that into the engine?

lithium534's profile picture
lithium5347 months ago

@threejs Where can I play this?

Martin Lorentzon's profile picture
Martin Lorentzon7 months ago

@threejs 👀👀👀

Related Videos