Giter Site home page Giter Site logo

meiya163254 / oasis-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from galacean/engine

0.0 0.0 0.0 15.24 MB

A typescript interactive engine, support 2D, 3D, animation, physics, built on WebGL and glTF.

Home Page: https://oasisengine.cn

License: MIT License

JavaScript 0.57% TypeScript 93.55% GLSL 5.88%

oasis-engine's Introduction

Galacean Engine

npm-size npm-download codecov

Galacean is a web-first and mobile-first high-performance real-time interactive engine. Use component system design and pursue ease of use and light weight. Developers can independently use and write Typescript scripts to develop projects using pure code.

Features

  • ๐Ÿ–ฅ ย Platform - Support HTML5 and Alipay miniprogram
  • ๐Ÿ”ฎ ย Graphics - Advanced 2D + 3D graphics engine
  • ๐Ÿƒ ย Animation - Powerful animation system
  • ๐Ÿงฑ ย Physics - Powerful and easy-to-use physical features
  • ๐Ÿ‘† ย Input - Easy-to-use interactive capabilities
  • ๐Ÿ“‘ ย Scripts - Use TypeScript to write logic efficiently

npm

The engine is published on npm with full typing support. To install, use:

npm install @galacean/engine

This will allow you to import engine entirely using:

import * as GALACEAN from "@galacean/engine";

or individual classes using:

import { Engine, Scene, Entity } from "@galacean/engine";

Usage

// Create engine by passing in the HTMLCanvasElement id and adjust canvas size
const engine = await WebGLEngine.create({ canvas: "canvas-id" });
engine.canvas.resizeByClientSize();

// Get scene and create root entity
const scene = engine.sceneManager.activeScene;
const rootEntity = scene.createRootEntity("Root");

// Create light
const lightEntity = rootEntity.createChild("Light");
const directLight = lightEntity.addComponent(DirectLight);
lightEntity.transform.setRotation(-45, -45, 0);
directLight.intensity = 0.4;

// Create camera
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.addComponent(Camera);
cameraEntity.transform.setPosition(0, 0, 12);

// Create sphere
const meshEntity = rootEntity.createChild("Sphere");
const meshRenderer = meshEntity.addComponent(MeshRenderer);
const material = new BlinnPhongMaterial(engine);
meshRenderer.setMaterial(material);
meshRenderer.mesh = PrimitiveMesh.createSphere(engine, 1);

// Run engine
engine.run();

Contributing

Everyone is welcome to join us! Whether you find a bug, have a great feature request or you fancy owning a task from the road map feel free to get in touch.

Make sure to read the Contributing Guide / ่ดก็ŒฎๆŒ‡ๅ— before submitting changes.

Build

Prerequisites:

  • Node.js v15.0.0+ and NPM (Install by official website)
  • PNPM (Install globally by npm install -g pnpm)

In the folder where you have cloned the repository, install the build dependencies using pnpm:

pnpm install

Then, to build the source, using npm:

npm run b:all

Links

License

The engine is released under the MIT license. See LICENSE file.

oasis-engine's People

Contributors

cleam avatar colorhook avatar cptbtptpbcptdtptp avatar czizzy avatar eyworldwide avatar guolei1990 avatar gz65555 avatar husong-sudo avatar hypnosnova avatar jtabibito avatar jujiex avatar liulinboyi avatar lixinhang avatar luzhuang avatar meiya163254 avatar mrkou47 avatar platearmourprogrammer avatar shiguanghai avatar singlecoder avatar susiwen8 avatar wellsliao avatar yangfengzzz avatar yunyoujun avatar zhuxudong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.