Wall/ room drawing prototype (like The Sims)

I want to create this prototype where you can draw walls on a grid (one square is one meter etc). The lines should snap to only corners of squares. And you should be able to draw straight lines and also diagonal.

I’m an experienced coder but not much experience with threejs or 2d/3d in general.

Would be very happy if I could get some pointers on what to play around with etc.

Treat each wall as a line between two points, that’s pretty much the entire magic. Will let you draw walls in any direction, with any amount of intersections, splittable, dissolvable, snappable etc. Plus you can reuse this data structure in both 2D and 3D - either drawing rectangles or boxes between the two points.

Maybe you can adapt it for your purposes?

and from the Collection of examples from discourse.threejs.org


1 Like