Git Product home page Git Product logo

three.multiplayer's Introduction

THREE Multiplayer

PRs Welcome

Looking for a React three fiber multiplayer template? check out R3F.Multiplayer

My boilerplate Node.js server and client setup for Three.js multiplayer projects using Socket.io

Multiplayer

Installation

  1. Clone the repo, e.g git clone https://github.com/juniorxsound/THREE-Multiplayer.git
  2. Run npm install to install all the dependencies

Tested on macOS 10.13.3 using Node.js v8.9.3 and npm v5.6.0

Usage

Use npm run start to start the server and bundler

NPM

The start script launches:

  • nodemon Which restarts the server on every change (port: 1989)
  • watchify Which bundles the client code from src/ on every change to ./public/js/bundle.js

Server Log

On connection each client recives it's uniqe ID and on every movement broadcasts to all the other clients all the locations of everyone connected

{
  'some-user-id': {
    position: [0.4, 1.4, -0.5],
    rotation: [0, 0, 0]
  }
}

You can also run npm run build to bundle and minify the client code to ./public/js/bundle.min.js

Browserify is setup to transform both ES6 Javascript and glslify for GLSL shader bundling (example of a project that uses glslify)

Pushing to Heroku

This is a detailed tutorial of how to push your code to Heroku through Github to serve your experience publicly

Special thanks to Dror Ayalon

three.multiplayer's People

Contributors

juniorxsound 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

three.multiplayer's Issues

Moving mesh instead of camera?

How can I move the mesh instead of the camera, using the controls? I understand that these controls don't support that because they need to rotate the camera, but I have my own controls. I just want to know which "variable" I can use to access the mesh/box.

Mouse picking please

Hi there!
First of all this is a really cool base plate
I've been looking for this for some time...

The one thing that I'm still searching for is to able to mouse pick object (using raycasting)
It's been done before obviously but I'm really looking for such a thing combined with 2way bindings to the server, much like what you are doing.
Basically an interactive, realtime, multiplayer environment.
Users can drag objects, seen in realtime by everyone, and will trigger events on server. Meanwhile, the server can choose to add objects to the scene and it will be displayed for all users.

I think what you've done covers a lot already. If anyone can link to a project that describes what I've stated please let me know, and if not I'll try building upon this here.

Thanks a lot and have a good one!
Tami

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.