Coder Social home page Coder Social logo

w's Introduction

W

A micro WebGL2 framework with a ton of features

https://xem.github.io/W

license: public domain

Install via NPM with npm install https://github.com/xem/W/#semver:1.0.1

w's People

Contributors

gogoprog avatar lukenickerson avatar stasm avatar xem 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

w's Issues

Questions about the usage

Hello, I just found your project and it looks great! But I have a few questions:

  • How to change texture (or size) individually per object? Do I really have to use W.move({n:"mario", size : ....?
  • How to control size of the object? For example, in your demo - https://xem.github.io/W/demos/6.html - what if I wanted to mach cube dimensions with canvas dimensions? Or to have fixed dimensions like 100px X 100px X 100px? I see demos are using 1 and increase/decrease with small steps, but I do not understand what is 1.
  • And is it possible to have a rectangles, like 200px X 100px x 20px ?
  • Is it possible to have different textures per side for the objects? For example, to create a cube where one side would be bricks, but other - trees?

Thanks!

Create an ESM build of the library so it can be imported

Background

ESM (modules) are the future; they let developers handle dependencies without polluting the window scope.

Improvements

  • Create a w.esm.js build that uses export default W

Challenges

Can this be done in a way that...

  • doesn't increase the final build of a game?
  • uses the same source file (so there aren't two divergent main js files)?

How to adjust camera distance?

The near and far values (the min and max values for the camera's frustrum?) are hard-coded to 1 and 1000. It would be useful to be able to adjust these. (Currently I'm working on a prototype of a solar system, and I'd like to use larger numbers for coordinates.)

I think this would involve adjusting the projection? https://github.com/xem/W/blob/gh-pages/w.js#L150 But I don't understand the math here. @xem I think this could be controlled via parameters on the camera method without adding too many bytes.

Add raycasting to add interaction through mouse or touch

I don't know how to implement a raycasting using W, there is some functionality to assist with raycasting?.
Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.
If hasn't some function, could u implement it or guide on a way to add it on the W?

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.