본문으로 건너뛰기
오픈소스 전체 목록

Babylon.js

  • 추천0
  • GitHub 별26K
  • 게임라이선스Apache-2.0

강력하고 아름다운 오픈 게임·렌더링 엔진. 친근한 자바스크립트 프레임워크로 WebGL·WebGPU 3D 게임을 만들어요

원본:BabylonJS/Babylon.js

요약

강력하고 아름다운 오픈 게임·렌더링 엔진. 친근한 자바스크립트 프레임워크로 WebGL·WebGPU 3D 게임을 만들어요

설명

Babylon.js 로고

Babylon.js

시작하시나요? 플레이그라운드에서 Babylon.js API를 바로 써 보세요. 사용법을 익힐 수 있는 샘플도 많이 들어 있습니다.

npm 버전 빌드 상태 이슈 평균 해결 시간 열려 있는 이슈 비율 빌드 크기 Twitter Discourse 사용자

궁금한 점이 있나요? 공식 포럼을 이용하세요.

CDN

⚠️ 경고: CDN은 프로덕션 환경에서 쓰면 안 됩니다. 우리 CDN의 목적은 플랫폼을 배우는 사용자나 작은 실험을 하는 사용자에게 Babylon 패키지를 제공하는 것입니다. 애플리케이션을 만들어 세상에 공개할 준비가 되었다면, 모든 패키지를 직접 운영하는 CDN에서 제공해야 합니다.

프리뷰 릴리스는 다음 주소를 쓰세요.

더 많은 참고 주소는 여기에서 볼 수 있습니다.

npm

BabylonJS와 모듈들은 완전한 타입 지원과 함께 npm에 배포됩니다. 설치하려면 다음을 쓰세요.

npm install babylonjs --save

또는 이제 ES6 패키지를 쓸 수도 있습니다. ES6 버전을 쓰면 트리 셰이킹을 비롯한 번들링 이점을 얻을 수 있습니다.

이렇게 하면 BabylonJS 전체를 다음처럼 가져올 수 있습니다.

import * as BABYLON from 'babylonjs';

또는 개별 클래스를 다음처럼 가져올 수 있습니다.

import { Scene, Engine } from 'babylonjs';

TypeScript를 쓴다면 tsconfig.json의 'types'에 'babylonjs'를 추가하는 것을 잊지 마세요.

    ...
    "types": [
        "babylonjs",
        "anotherAwesomeDependency"
    ],
    ...

모듈을 추가하려면 해당 패키지를 설치하세요. 추가 패키지 목록과 설치 안내는 npm의 babylonjs 사용자 페이지에서 볼 수 있습니다.

사용법

시작하기를 보세요.

// Get the canvas DOM element
var canvas = document.getElementById('renderCanvas');
// Load the 3D engine
var engine = new BABYLON.Engine(canvas, true, {preserveDrawingBuffer: true, stencil: true});
// CreateScene function that creates and return the scene
var createScene = function(){
    // Create a basic BJS Scene object
    var scene = new BABYLON.Scene(engine);
    // Create a FreeCamera, and set its position to {x: 0, y: 5, z: -10}
    var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5, -10), scene);
    // Target the camera to scene origin
    camera.setTarget(BABYLON.Vector3.Zero());
    // Attach the camera to the canvas
    camera.attachControl(canvas, false);
    // Create a basic light, aiming 0, 1, 0 - meaning, to the sky
    var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0, 1, 0), scene);
    // Create a built-in "sphere" shape using the SphereBuilder
    var sphere = BABYLON.MeshBuilder.CreateSphere('sphere1', {segments: 16, diameter: 2, sideOrientation: BABYLON.Mesh.FRONTSIDE}, scene);
    // Move the sphere upward 1/2 of its height
    sphere.position.y = 1;
    // Create a built-in "ground" shape;
    var ground = BABYLON.MeshBuilder.CreateGround("ground1", { width: 6, height: 6, subdivisions: 2, updatable: false }, scene);
    // Return the created scene
    return scene;
}
// call the createScene function
var scene = createScene();
// run the render loop
engine.runRenderLoop(function(){
    scene.render();
});
// the canvas/window resize event handler
window.addEventListener('resize', function(){
    engine.resize();
});

기여하기

이 저장소를 빌드하고 개발하려면 Node.js 22 계열은 22.22.2 이상, Node.js 24 계열은 24.16.0 이상, npm은 11.18.0 이상이 필요합니다. 이는 개발 도구의 요구사항이며, 배포된 Babylon.js 라이브러리의 실행 요구사항을 바꾸지 않습니다.

기여하고 싶다면 먼저 기여 가이드라인을 읽어 주세요.

문서

유용한 링크

기능

지원하는 기능의 전체 목록은 웹사이트에서 확인하세요.


저장소: BabylonJS/Babylon.js · 라이선스: Apache-2.0

평점

–평가 0개 기준
5점
0
4점
0
3점
0
2점
0
1점
0