GithubHelp home page GithubHelp logo

tchigher / engine-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from galacean/engine

0.0 0.0 0.0 563 KB

Oasis Engine is a web-first and mobile-first high-performance real-time development platform.

License: MIT License

JavaScript 1.78% TypeScript 89.39% GLSL 8.83%

engine-1's Introduction

Oasis Engine (Ant Graphics Engine)

Oasis logo

npm-version npm-size npm-download

Oasis is a web-first and mobile-first high-performance real-time development platform. Using component system design, and pursues ease of use and lightweight. This repository is the core engine of Oasis. Developers can independently use and write Typescript scripts to develop projects using pure code.

Features

  • ๐Ÿ–ฅ ย Platform - Suppport HTML5 and Alipay miniprogram
  • ๐Ÿ”ฎ ย Graphics - Advanced 2D + 3D graphics engine
  • ๐Ÿƒ ย Animation - Powerful animation system
  • ๐Ÿ“‘ ย Scripts - Use TypeScript to write logic efficiently

Usage

// Create engine by passing in the HTMLCanvasElement name and get root entity.
const engine = new WebGLEngine("canvas");
const canvas = engine.canvas;
const rootEntity = engine.sceneManager.activeScene.createRootEntity("Root");
canvas.width = window.innerWidth * SystemInfo.devicePixelRatio;
canvas.height = window.innerHeight * SystemInfo.devicePixelRatio;

// Create light.
const lightEntity = rootEntity.createChild("Light");
const ambient = lightEntity.addComponent(AmbientLight);
const directLight = lightEntity.addComponent(DirectLight);
ambient.color = new Color(0.5, 0.5, 0.5);
directLight.color = new Color(0.3, 0.4, 0.4);

// Create camera.
const cameraEntity = rootEntity.createChild("Camera");
cameraEntity.transform.setPosition(0, 6, 10);
cameraEntity.transform.lookAt(new Vector3(0, 0, 0));
cameraEntity.addComponent(Camera);

// Create cube.
const cubeEntity = rootEntity.createChild("Cube");
const cubeRenderer = cubeEntity.addComponent(GeometryRenderer);
const material = new BlinnPhongMaterial(engine);
cubeEntity.transform.rotate(0, 60, 0);
material.ambientColor = new Color(0.6, 0.6, 0.6, 1);
cubeRenderer.geometry = new CuboidGeometry(engine, 1, 1, 1);
cubeRenderer.material = material;

// Run engine.
engine.run();

npm

Oasis Engine are published on npm with full typing support. To install, use:

npm install oasis-engine

This will allow you to import Oasis Engine entirely using:

import * as OASIS from "oasis-engine";

or individual classes using:

import { Engine, Scene, Entity } from "oasis-engine";

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

If you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned the repository, install the build dependencies using npm:

npm run bootstrap

Then, to build the source, using npm:

npm run build

The docs can be generated using npm:

npm run doc

Links

License

The Oasis Engine is released under the MIT license. See LICENSE file.

engine-1's People

Contributors

gz65555 avatar guolei1990 avatar zhuxudong avatar singlecoder avatar eyworldwide avatar luzhuang avatar liulinboyi 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.