GithubHelp home page GithubHelp logo

avatarchik / export3js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tosh823/export3js

0.0 0.0 0.0 29.47 MB

Unity to Three.JS exporter

License: GNU General Public License v3.0

C# 100.00%

export3js's Introduction

About

You want export your static scene from Unity to Three.JS? Well, here you go, this package could export some stuff.

Supported types

  • Transforms hierarchy
  • Mesh geometries
  • Lights
    • Ambient Light
    • Directional Lights
    • Point Lights
    • Spot Lights
  • Materials
    • Basic materials
    • Multimaterials
    • Textures, normal maps, specualar maps, emmissive maps
    • Opacity
  • Cameras
    • Perspective Camera
    • Orthographic Camera

!Warning: not everything is tested, but should work. Development is in progress.

Installation

Place Export3JS folder in your Unity project assets folder, and corresponding menu item must appear in Unity's menu panel.

Usage

In the exportation window select options you need and choose the folder for output file.

In Tags submenu you can choose tags you wanted to trace. Then exporter will also create {SceneName}Tags.json file in the output folder with following format:

tags: {
 ExampleTag: [
  "THREE Object UUID"
 ],
 ...
}

In your Three.JS code then read this file, find objects by their uuids and do whatever you need.

If scene contains spotlights, exporter will create another .json file in output directory, named {SceneName}LightsConfig.json. Three.JS spotlights doesn't use their rotation and need a target object to be able to shine in specific direction. The format of this helper file is following:

spotlights: {
 "Light Object UUID": [
  x,
  y,
  z
 ],
 ...
}

For each spotlight in scene there are coordinates of abstract target object, that you need to create manually in your Three.JS code.

After job is done, load JSON file with ObjectLoader:

var loader = new THREE.ObjectLoader();
loader.load('assets/output.json',
  function onLoad(object) {
    scene.add(object);
    // Or even like this, because exporter exports into ready for use THREE.Scene
    // scene = object;
    console.log('Scene has loaded, yeah!');
  }
);

export3js's People

Contributors

tosh823 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.