MakeIt3D Documentation
website·Indexed 30 days ago
https://make-it-3d.vercel.appA Construct 3 plugin that integrates Three.js capabilities and the Rapier Physics engine into game projects. It provides a set of Actions, Conditions, and Expressions (ACE) for managing 3D elements, lighting, and materials, alongside a Context API for JavaScript scripting to handle dynamic bodies, forces, and spatial queries.
What's inside MakeIt3D
- MakeIt3D is a plugin that brings professional 3D capabilities to Construct 3, powered by Three.js and WebGL. It allows developers to render 3D graphics at 60fps across modern browsers and deploy to web, mobile, and desktop platforms. Key features include support for GLB/GLTF and Fbx model loading, rich materials (textures, lighting, shadows), an animation system with blending and transitions, and an inbuilt three.js editor for level creation.
Overview of MakeIt3D for Construct 3
MakeIt3D is a Construct 3 plugin that integrates the Three.js library to enable 3D graphics within the Construct 3 environment.
Critical Technical Constraint: MakeIt3D uses a separate Three.js rendering system that overlays the Construct 3 canvas. Because it is a standalone rendering solution, 3D objects do not integrate with Construct's native layout system, sprite behaviors, or collision detection. It is controlled via events rather than the standard 2D object system.
Overview of MakeIt3D for Construct 3
MakeIt3D is a Construct 3 plugin that integrates Three.js functionality, allowing developers to create 3D platformers, immersive experiences, or add 3D elements to 2D games. It features a visual Three.js editor, seamless integration with the Construct 3 event system, and is optimized for performance.Overview of Rapier 3D capabilities in Construct 3
The Rapier plugin provides a set of Actions, Conditions, and Expressions (ACE) for Construct 3 Event Sheets to manage 3D physics and rendering. Key capabilities include:
- 3D Object Creation: Dynamically spawning and manipulating 3D objects.
- Scene Management: Controlling cameras, lighting, and environments.
- Physics Integration: Implementing realistic physics within 3D scenes.
- Material Systems: Applying shaders, textures, and visual effects.
Retrieve collision data from 3D objects
Use these expressions to get detailed information about collisions between objects in the 3D scene.// Object IDs MakeIt3D.SelfObjectId // ID of the object checking for collision MakeIt3D.OtherObjectId // ID of the other object involved in collision // Impact and Contact MakeIt3D.TotalImpulse // Total impulse applied (number) MakeIt3D.HasActiveContact // True if at least one active contact point exists (boolean) MakeIt3D.ContactPointsCount // Number of contact points in most recent collision // Detailed Data (JSON strings) MakeIt3D.ContactNormalsJson // Compact JSON of all contact normal vectors MakeIt3D.ContactPointsJson // Compact JSON of positions, impulses, distances MakeIt3D.CollisionDataJson // Full collision data (normals, points, impulses) MakeIt3D.CollisionDataBeautified // Human-readable JSON for debuggingUnderstand MakeIt3D rendering and Construct 3 integration
MakeIt3D utilizes a standalone Three.js rendering system that overlays on the Construct 3 canvas. Because it is a separate system, 3D objects do not integrate with Construct 3's native layout system, sprite behaviors, or 2D collision detection. Control of the 3D environment is managed exclusively through events via the provided Actions, Conditions, and Expressions (ACE).Core capabilities of the MakeIt3D API
The MakeIt3D API provides a set of Actions, Conditions, and Expressions (ACE) for Construct 3 Event Sheets to handle the following 3D tasks:
- 3D Object Creation: Dynamically spawn and manipulate 3D objects.
- Scene Management: Control cameras, lighting, and environments.
- Physics Integration: Implement realistic physics within 3D scenes.
- Material Systems: Apply shaders, textures, and various visual effects.
Understand the runtime-based 3D workflow
The addon does not include a built-in 3D editor panel. Instead, all 3D elements are built at runtime using events. This approach is designed to keep projects lightweight compared to importing large JSON files from the Three.js Editor.Understand MakeIt3D rendering and integration limits
MakeIt3D is a standalone 3D rendering solution for Construct 3 based on Three.js. It operates as a separate rendering system that overlays the Construct 3 canvas. Because it is not an extension of the 2D object system, 3D objects do not integrate with Construct 3's layout system, sprite behaviors, or built-in collision detection.Load a 3D scene from JSON
TheLoad Scene From JSONaction allows you to load a scene previously saved by the three.js editor. You can specify the JSON path and choose whether to use the camera defined within the JSON file.// Example: Load scene from a specific JSON path MakeIt3D.CreateScene(0, 'path/to/scene.json', false, false, true, true, true)Implement a Three-Point Lighting setup
Use a combination of Key, Fill, and Rim lights to create professional 3D lighting. The Key light acts as the main source, the Fill light softens shadows, and the Rim light separates the object from the background.// Key Light (main light source) MakeIt3D.CreateDirectionalLight("keyLight", "#FFFFFF", 1.2) MakeIt3D.SetLightPosition("keyLight", 5, 5, 5) // Fill Light (softer, fills shadows) MakeIt3D.CreateDirectionalLight("fillLight", "#87CEEB", 0.6) MakeIt3D.SetLightPosition("fillLight", -3, 2, 3) // Rim Light (separates object from background) MakeIt3D.CreateDirectionalLight("rimLight", "#FFE4B5", 0.8) MakeIt3D.SetLightPosition("rimLight", 0, -2, -5)Listen for and process collision events
Collision events are managed via theeventQueue. UsedrainCollisionEventswithin a frame-based tick function to process collisions. This method provides the handles of the two colliders involved and a boolean indicating if the collision started or ended. To map these handles back to object IDs, iterate through theobjectsregistry.const { world, eventQueue, objects } = window.MakeIt3DContext.rapierContext; function processCollisionEvents() { eventQueue.drainCollisionEvents((handle1, handle2, started) => { if (started) { // Map handles to object IDs let objectId1 = null, objectId2 = null; for (const [id, objectData] of objects.entries()) { if (objectData.collider && objectData.collider.handle === handle1) objectId1 = id; if (objectData.collider && objectData.collider.handle === handle2) objectId2 = id; } console.log("Collision started between:", objectId1, objectId2); } }); } function onTick(runtime) { processCollisionEvents(); }