Skip to content
← Back to Community
How Can I Make 3D Games?
Profile icon
Battledash2

Hi! I'm trying to learn CSS transforms and stuff to make a 3D game. I managed to get 1 cube but I can't figure out how I would possibly get a second one without hard coding. Right now that 1 cube is hard coding in CSS using position absolute, trying to duplicate it would cause them to go inside of each other..

Thanks!

Voters
Profile icon
Vishan43
Profile icon
Battledash2
Comments
hotnewtop
Profile icon
ch1ck3n

CSS Is for styling, not for 3D stuff. if you work really hard, you might be able to make a 3D game with CSS.
https://www.w3schools.com/js/js_htmldom_css.asp

Profile icon
Battledash2

I already know how to style CSS with Javascript 😑 @ch1cken

Profile icon
Coder100

No, CSS is not what you use to make 3D games.

You are better off with using three.js

Profile icon
Battledash2

@Coder100 I don't wanna use external libraries. I'm not a fan of that type of stuff and I don't like using frames.

Profile icon
repl-account

@Battledash2 Read 5 minutes of this and you will immediately change your mind. CSS transformations are way to laggy to do anything, there are way less resources than WebGL, and it is a lot harder to make a game with it. Here is a simple version of Minecraft that I made using ThreeJS and here is something to help with animations.

Profile icon
Battledash2

@lilpeen I might learn that after, but I want CSS transforms atm.

Profile icon
Coder100
Profile icon
Battledash2
Profile icon
Coder100
Profile icon
Battledash2
Profile icon
Battledash2

I have a new post, think you can help me with it?

Link: https://repl.it/talk/ask/How-can-I-make-a-Javascript-Obfuscator/55578

@Coder100

Profile icon
Coder100
Profile icon
Battledash2
Profile icon
Coder100

np, did it solve your question? @Battledash2

Profile icon
Coder100

or do you want an actual obsfucator? (I do not recommend, it's not going to help you nor anyone else) @Battledash2

Profile icon
BrightSideSide

I recently made a 3d model in HTML (if you're using an android device it supports AR) using js open sours code I imported externally you can find more of that in the tutorial I linked down. I don't think so it's possible with CSS, as CSS is more for the looks of the page which is 2d like shown here:https://scriptdownloader.tk/CSS_Internal.html

my tutorial:https://replit.com/talk/learn/how-to-make-augmented-reality/140450
my project: https://replit.com/@BrightSideSide/donut#index.html

Profile icon
Battledash2

Nice! It's been 10 months since I posted this, and ngl, I realize that it's not the greatest idea to make a 3D game in CSS, lol @BrightSideSide