Skip to content

mihailik/three-pop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THREE-pop — popping a quick THREE.js demo with least effort

This will give you a quick rotating cube setup:

import * as THREE from 'three';
import { createScene } from 'three-pop';

const { scene, container } = createScene();

scene.add(new THREE.Mesh(
  new THREE.BoxGeometry(1, 1, 1),
  new THREE.MeshBasicMaterial({ color: 0x00ff00 })
));

document.body.appendChild(container);

Live demo: https://raw.githack.com/mihailik/three-pop/refs/heads/main/index.html

Live demo of rotating green cube

Constructed parts of the scene

When you call createScene() you get a scene and a bunch of other THREE objects and things. Add your 3D objects, and pop it on the page.


You can pass parameters into createScene({ ... }):

const { scene, container } = createScene({
  renderer: { antialias: true },
  camera: { fov: 50 }
});

License

MIT   Oleg Mihailik's face Oleg Mihailik

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors