All Projects → my2iu → pixi-omber-gltf2-vector

my2iu / pixi-omber-gltf2-vector

Licence: MIT License
Pixi.js library for using vector art created in Omber that's saved in glTF 2.0 format

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to pixi-omber-gltf2-vector

Pixi Live2d
Display live2D model as a sprite in pixi.js.
Stars: ✭ 537 (+4030.77%)
Mutual labels:  pixijs, pixi
Pixi.js
The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
Stars: ✭ 34,982 (+268992.31%)
Mutual labels:  pixijs, pixi
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (+3484.62%)
Mutual labels:  pixijs, pixi
Leaflet.pixioverlay
Bring Pixi.js power to Leaflet maps
Stars: ✭ 264 (+1930.77%)
Mutual labels:  pixijs, pixi
Pixi Sound
WebAudio API playback library, with filters. Modern audio playback for modern browsers.
Stars: ✭ 201 (+1446.15%)
Mutual labels:  pixijs, pixi
Pixi Seed
Pixi.js project seed with ES6 and webpack
Stars: ✭ 149 (+1046.15%)
Mutual labels:  pixijs, pixi
React Pixi Fiber
Write PixiJS applications using React declarative style.
Stars: ✭ 568 (+4269.23%)
Mutual labels:  pixijs, pixi
pixi-miniprogram
一个可运行于微信小程序的PIXI引擎,通过模拟window环境,有些功能小程序无法模拟,就直接修改了PIXI引擎代码,最终使得PIXI引擎正常运行在小程序上
Stars: ✭ 72 (+453.85%)
Mutual labels:  pixijs, pixi
Gown.js
UI system for pixi.js inspired by feathers-ui
Stars: ✭ 195 (+1400%)
Mutual labels:  pixijs, pixi
Pixi Haxe
Externs of Pixi.js for Haxe
Stars: ✭ 175 (+1246.15%)
Mutual labels:  pixijs, pixi
pixi-shim
PIXI.js Back-End "shim". For mocking Canvas in Node.js with ❤️
Stars: ✭ 45 (+246.15%)
Mutual labels:  pixijs, pixi
pixijs-ts-boilerplate
Just another PixiJS Typescript Boilerplate with some basic functionalities
Stars: ✭ 54 (+315.38%)
Mutual labels:  pixijs, pixi
GLTFKit2
A glTF 2.0 asset loader and exporter for Objective-C and Swift.
Stars: ✭ 30 (+130.77%)
Mutual labels:  gltf
pg2b3dm
Tool for converting from PostGIS to b3dm tiles
Stars: ✭ 138 (+961.54%)
Mutual labels:  gltf
parcel-pixijs-quickstarter
Example App using pixiJS and Typescript bundled with parcel
Stars: ✭ 48 (+269.23%)
Mutual labels:  pixijs
mixed-reality-extension-sdk
The Mixed Reality Extension SDK enables developers to build 3D world extensions for AltspaceVR, using Node.JS.
Stars: ✭ 139 (+969.23%)
Mutual labels:  gltf
vpype-pixelart
Pixel art plotting in vpype
Stars: ✭ 40 (+207.69%)
Mutual labels:  vector-graphics
gltf
👓 Go library for encoding glTF 2.0 files
Stars: ✭ 156 (+1100%)
Mutual labels:  gltf
AnimatedVectorDrawableCompat-play-to-reset-button
An Android app using the AnimatedVectorDrawable support library
Stars: ✭ 56 (+330.77%)
Mutual labels:  vector-graphics
BezierKit
Bezier curves and paths in Swift for building vector applications
Stars: ✭ 190 (+1361.54%)
Mutual labels:  vector-graphics

glTF 2.0 Vector Graphics Plugin for Pixi.js

Screenshot of vector art used in Omber

pixi-omber-gltf2-vector is a plugin for accelerated vector graphics on the Pixi.js JavaScript graphics engine. Vector graphics are particularly useful for HTML5 games because it offers smaller file sizes than bitmaps for high resolution art that contains transparency.

With the plugin, you can load vector art encoded as a 3d mesh in glTF 2.0 format and then use the art in a game just like a normal Pixi.js sprite. Although the plugin is specifically designed to work with vector art created in the drawing program Omber, Omber has some support for loading SVG files and then resaving them out in glTF format.

Using the Plugin

The example directory contains a simple of example that uses the plugin to display some vector art, but a more detailed explanation of the steps needed to use the plugin is provided below.

1. Export vector art

The plugin loads vector art that has been converted into 3d meshes that can be rendered quickly by 3d graphics hardware. Use the Omber vector dawing program to create your vector art and then export your art to glTF format using these suggested settings. The plugin currently expects data to exported as a .GLB file and NOT using floating-point colors. It is recommended that you use 1 pixel per meter for the scale, and to output meshes using the "Merge opaque meshes only" setting. When exporting, be sure to note the position of your drawing relative to the origin point of x=0, y=0. When displaying vector art in Pixi, the art will be centered around this origin point, so you may have to move your drawing before exporting so that the origin point is a reasonable location.

2. Include the plugin code

Include the Pixi.js library and the pixi-omber-gltf2-vector plugin code in your HTML file. Be sure to include the plugin AFTER you include the Pixi library. A pre-built version of the plugin is available in the build directory.

<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.7.3/pixi.min.js"></script>
<script src="build/pixi-omber-gltf2-vector.js"></script>

The pixi-omber-gltf2-vector API is accessible from the PIXI.omber namespace.

3. Load the glTF .glb files

After you initialize Pixi, you can use the standard Pixi loader to load the glTF 2.0 .glb files that you exported earlier

PIXI.loader
	.add('vector.glb')
	.load(start);

4. Use PIXI.omber.VectorMesh instead of PIXI.Sprite

The plugin will load the .glb files as Gltf objects instead of the Texture objects used for bitmap sprites. To display them, create a PIXI.omber.VectorMesh object instead of the normal PIXI.Sprite object. Continue to use PIXI.Sprite for your regular bitmap sprites.

function start(loader, resources) {
	let mesh = new PIXI.omber.VectorMesh(resources['vector.glb'].gltf);
	app.stage.addChild(mesh);
}

5. Basic Pixi operations are supported

The regular Pixi transforms are currently supported by VectorMesh. For example, you can assign x, y, rotation, scale values on a mesh to move it around the screen. Basic rectangular hitboxes for detecting touches and clicks on vector objects are also supported.

Examples

Various examples are provided that demonstrate how the PIXI plugin can be used.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].