Git Product home page Git Product logo

goojs's Introduction

Goo Engine

Goo Engine is an open-source 3D engine using HTML5 and WebGL for rendering.

Showcases



More showcases...

Install

Browser: add the following to your webpage.

<script src="http://code.gooengine.com/latest/lib/goo.js"></script>

Node.js:

npm install --save goojs

Sample code

Open on codepen

// var goo = require('goojs'); // (for node.js)

// Create a runner
var gooRunner = new goo.GooRunner();
var world = gooRunner.world;

// Add the canvas to the DOM
document.body.appendChild(gooRunner.renderer.domElement);

// Add a light entity
world.createEntity(new goo.PointLight(), [100, 100, 100]).addToWorld();

// Add a camera entity
world.createEntity(new goo.Camera(), new goo.OrbitCamControlScript({spherical: [5,0,0]})).addToWorld();

// Add a box entity with a rotation script
world.createEntity(new goo.Box(), goo.Material.createMaterial(goo.ShaderLib.simpleLit), function update(entity) {
    entity.setRotation(world.time, world.time, 0);
}).addToWorld();

Documentation

Releases

Goo Create Platform

Goo Create is a complete 3D authoring platform built on top of the Goo Engine.

How to build

npm install
npm install -g grunt-cli
grunt minify

Unit testing

  • Run grunt unittest to run all tests using Karma
  • Run npm test to test the parts of the engine that are supported in Node.js

Visual tests

Start a web server, e.g. using:

npm install st -g
st --port 8000

And then open:

Code style checks

To make sure that no incorrectly styled code gets committed, install the pre-commit hook:

grunt init-git

This makes Git check whether all added and modified files pass the style check before allowing a commit.

Documentation

grunt jsdoc - outputs to out-doc

GooJS uses a custom documentation compiler, modoc; see tools/modoc/README.md for more details.

Building details

  • Minified and mangled: grunt minify
  • Minified: grunt minify-no-mangle
  • Concatenated: grunt minify-dev

License

The Goo Engine is released under the MIT license.

goojs's People

Contributors

adrianton3 avatar boardthomas avatar bunzaga avatar chorned avatar chribbe avatar dansun avatar flonka avatar goo-dan avatar hccampos avatar informatiq avatar jockegoo avatar m4kke avatar marcusstenbeck avatar mariosnikolaou avatar oskasb avatar puneeshmotwani avatar renanse avatar rherlitz avatar schteppe avatar sinetheta avatar victorsand avatar vilcans avatar vladibb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goojs's Issues

GooCreate Opensource?

Hi

Does GooCreate still exist?

If so, what are the plans with its' source code? As far as I understand, there is the engine here but not the editor.

Cheers
M

What should happen when applying opacity less than 1 to a node with descendants?

Hello Adrian, Rikard, and contributors,

I'd like your opinion:

If we have a node in a 3D scene, and it has many descendants (a sub tree), what should happen when we apply opacity with a value less than 1 to it?

  1. It, and all of it's children should become transparent, multiplying opacities down the scene graph.
  2. It's content should become transparent but not that of its descendants.
  3. Same as (1), but the whole object should be flattened into a plane.

The reason I want your opinion is because the new specs for CSS 3D (css-transforms) state here that the answer is (3).

To see what I mean, view these two examples in Chrome 53 or higher:

The second example has opacity applied to the node that contains all the sub-nodes which compose the car. The opacity, according to spec, flattens the car into a plane (turns it into paper!).

I'm asking various 3D engine authors for opinions of what the correct or most expected behavior should be.

All the best,
~ Joe

Tween updates are depending on fsmpack

The Tweens are updated by the StateMachineSystem. Should it really be like this? Removing fsmpack.js will stop tweens :P

Solution: keep track of the local time in the actions, and use the tweening functions directly. This may sound tedious but I think it can reduce the amount of code.

Building WebGL libraries that work with each other in the same webgl context.

Description of the problem

It's difficult and complex these days to mix WebGL libraries together, to draw things using different libraries in the same webgl context. (examples of difficulties: mrdoob/three.js#8147, pixijs/pixijs#3230, pixijs/pixijs#3345, pixijs/pixijs#1366, pixijs/pixijs#298, jonobr1/two.js#233)

For example, suppose we would like to render Three, Babylon, and Pixi objects into the same WebGL context, in the same 3D space.

It is currently very difficult to do this because each WebGL library manages state of the context in their own ways, and these private internals often change and break solutions that people come up with because there's no standard way to do it.

Pixi.js v4 goes through efforts to make Pixi compatible with Three.js, so that it can render in a Three scene, but this is obviously fragile.

Solution

Enter Regl to the party.

Maybe if the foundations for each library (Three, Babylon, Pixi, Two, etc) were built on Regl, we'd have a common way of rendering to a single context.

Regl makes an abstraction just on top of raw WebGL for managing WebGL state. It doesn't render for you all the things that Three.js can, it only provides the minimal foundation for working with raw WebGL in a stateful way that is easy to manage.

It seems that libraries like Three, Babylon, PlayCanvas, Pixi, Two, etc, could benefit from using a standardized way for managing WebGL state, which would make it easy to combine renderings from any of these libraries into the same WebGL context.


What are your thoughts on refactoring the foundation of Goo to use Regl for managing WebGL state? Does Regl offer enough flexibility for Goo to do what it needs to do on top of Regl?

TriggerEnter stops working after a few events

Reported by bunzaga.

Any ideas regarding this old demo: https://create.goocreate.com/edit/db361deed21f4ad8b5630ffb11d79fc4.scene I tried changing it to use onTriggerStay, but it still does the same thing. It behaves like something in the physics engine crashes, and just stops responding to the cubes over time.

Basically, if you move the camera so the smaller cubes are inside of the sphere, then hold down the left mouse button, the cubes should be picked up and try to stay in the center of the sphere. When you let go of the left mouse, they should drop like normal. If you continuously pick them up and drag them around, suddenly they just stop reacting to the trigger events.

https://c1.goote.ch/db361deed21f4ad8b5630ffb11d79fc4.scene Here is the demo, so you don't need to open and build, etc.

Here's a little (unlisted) video to help: https://youtu.be/91xojYiY67g

Let Matrix3.prototype.fromAngleVector accept a Vector3

Currently, Matrix3x3.prototype.fromAngles takes three separate parameters: x, y, z. It would be nice if there was an additional function, or added functionality to the current 'fromAngles', to accept a Vector3 Object as well:

var rot = new goo.Matrix3x3();
entity.transformComponent.transform.rotation.toAngles(rot); // notice a Vector3 passed in here...
rot.y += ctx.world.tpf;
// this would be nice!
entity.transformComponent.transform.rotation.fromAngleVector(rot); // we pass in the Vector3 here as well.

Currently, we have to pass in each part of the Vector3:
entity.transformComponent.transform.rotation.fromAngles(rot[0]. rot[1], rot[2]);

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.