Skip to main content

WebGL2 jupyter widget

Project description

ipywebgl


A WebGL2 widget for Jupyter Lab

Documentation Status

Introduction

This module is exposing a part of the WebGL2 context. Is is assumed that you are familiar with the concepts and commands. You can find more information about it here : https://webgl2fundamentals.org/

There is some major differences still :

  • All the WebGL2 commands are called on the GLViewer instead of a gl context.
  • All the API is written in snake_case instead of camelCase, so for example gl.drawArrays(...) in JavaScript becomes widget.draw_arrays(...) in Python
  • Masks parameters are replaced by positional attribute, so for example gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); in JavaScript becomes widget.clear(depth_buffer_bit=True, color_buffer_bit=True) in Python
  • Enums are replaced by strings, so for example gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW); in JavaScript becomes widget.buffer_data("ARRAY_BUFFER", data, "DYNAMIC_DRAW") in Python
  • There is no delete functions, once something is created it stays created (we are in a prototype environment).
  • You will find some 'Extended' methods that can simplify some calls like the create_vertex_array_ext that will create and link the programs and buffers all at once.

Not all the functions are exposed as of today. If you need more, feel free to ask on github https://github.com/JeromeEippers/ipywebgl.

All the commands you call on the GLViewer are push to a commands buffer. That commands buffer is only flushed when you call the execute_commands() method.

Installation

You can install using pip:

pip install ipywebgl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipywebgl-0.4.0.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

ipywebgl-0.4.0-py3-none-any.whl (559.4 kB view details)

Uploaded Python 3

File details

Details for the file ipywebgl-0.4.0.tar.gz.

File metadata

  • Download URL: ipywebgl-0.4.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for ipywebgl-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a6d134aa2d2bde3cfdb686ae14430c38df6e5b3fa596b1e360f58b49d9792014
MD5 fa6e1a89e5ae5b036767fc290f0f21f1
BLAKE2b-256 56fc37a737c841c59a5f22cab49edf5384082f1d1465447379e3974f935e7264

See more details on using hashes here.

File details

Details for the file ipywebgl-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ipywebgl-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 559.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for ipywebgl-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5044af09364bf3d57b2c6c5ee80bb70c9d5cabc3d18e9cd896aaa7ea9bf3d537
MD5 f27917ddeb4a45099adc487ebf233cb0
BLAKE2b-256 fba0f1331ecfec1a1af10ab6a639672694a76ffa4078b536df6fbfadeb11507d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page