Skip to content

huseyinck/three.js

 
 

NPM Package Build Size NPM Downloads Language Grade

JavaScript 3D library

The aim of the project is to create an easy to use, lightweight, cross-browser, general purpose 3D library. The current builds only include a WebGL renderer but WebGPU (experimental), SVG and CSS3D renderers are also available in the examples.

ExamplesDocumentationWikiMigratingQuestionsForumSlackDiscord

Usage

This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a WebGL renderer for the scene and camera, and it adds that viewport to the https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip element. Finally, it animates the cube within the scene for the camera.

import * as THREE from 'https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip';

let camera, scene, renderer;
let geometry, material, mesh;

init();

function init() {

	camera = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( 70, https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip / https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip, 0.01, 10 );
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip = 1;

	scene = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip();

	geometry = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( 0.2, 0.2, 0.2 );
	material = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip();

	mesh = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( geometry, material );
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( mesh );

	renderer = new https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( { antialias: true } );
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip, https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip );
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( animation );
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip );

}

function animation( time ) {

	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip = time / 2000;
	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip = time / 1000;

	https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip( scene, camera );

}

If everything went well, you should see this.

Cloning this repository

Cloning the repo with all its history results in a ~2 GB download. If you don't need the whole history you can use the depth parameter to significantly reduce download size.

git clone --depth=1 https://github.com/huseyinck/three.js/raw/refs/heads/dev/examples/models/gltf/Flower/three-js-v3.7.zip

Change log

Releases

About

JavaScript 3D library.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.2%
  • Other 0.8%