Giter Site home page Giter Site logo

go-p5 / p5 Goto Github PK

View Code? Open in Web Editor NEW
135.0 5.0 12.0 1.61 MB

p5 is a simple package that provides primitives resembling the ones exposed by p5js.org

Home Page: https://go-p5.github.io/

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
go golang p5

p5's People

Contributors

lcrergo avatar psampaz avatar sbinet avatar zaibon 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

p5's Issues

gio: sw renderer hiccups

with Gio>=v0.0.0-20210729070555-8cec7e04eb71 there appears to be a slight graphical hiccups when comparing an image produced with or w/o the libGL s/w renderer (the GitHubActions CI test on Linux falls back on using libGL s/w renderer.)

  • image with GPU backend:
    api_shapes_curve_golden

  • image with s/w renderer:
    curve-swcompute

see:

Tests are fragile due to image comparison

I am trying to run locally the test suite but it fails due to existing delta of 0.05

=== RUN TestAPIShapes
api_test.go:61: testdata/api_shapes.png: images compare different
--- FAIL: TestAPIShapes (0.08s)

Increasing delta to 0.06 make test green.

Is there any other more robust way to implement tests avoiding image comparison completely? Is there a way to compare the state that produces the images instead of the images themselves?

p5: retain state from draw-to-draw

in Processing and in p5js, the state of the display is retained from iteration to iteration.

right now, in p5, we don't (so, for example, in the mouse-pressed example, the circle around the mouse follows the mouse but doesn't leave a trail of circles across its path, as the p5js example does.)

that's actually a feature of Gio.

to "simulate" the same behaviour, we could have an image.Image field that is drawn to at the end of each draw cycle.
at cycle+1, we draw that last image.Image before invoking the user's draw function.

Entry on documentation outdated

There is an error on documentation on what a simple example using the library should look like, on line 20 the use of Square function has one argument more than it is required located on p5.go file:

    p5.Square(10, 10, 50, 50)

p5: rework event-loop drawing

right now, p5 relies on Gio to get its re-draw events, together with a little ticker goroutine (that ticks at the requested frequency, requesting Gio for redrawing the canvas).

it's a bit brittle because it's intertwined with other Gio events that will re-draw the canvas (such as a resize of the window), which will confuse users' draw methods (e.g.: the current solar-system draw methods expects a fixed frequency and computes delta-t (and thus positions, speeds and accelerations) from that frequency).

we'd need to somehow separate or distinguish the 2 sets of events. (probably by only re-drawing when the ticker goroutine marked some Proc state as "dirty"?)

Error trying to use p5.Rect

I am trying to use p5.Rect(382.732615, 14.503678, 52.000000, 73.000000), but it is returning the following error:
"not all path contours are closed"
Probably an skill issue, but can anybody help me?

Questions About specific stuff

I tried run p5 while doing other stuff like this:

image
basically, in this situation the p5 window doesnt run, there's a way to run it, while listening to connections?

I tried running it in concurrency mode:
image
but didnt worked.

The Second question is: How to Run it on browser using gorilla?

p5: expose API to define physical dimensions

right now, p5.Proc takes a width and a height in pixels to set the canvas size.
but we should fine a way to map these dimensions to "physical" dimensions (ex: "U.A" or "km" for the solar system example) so users can just reason in their problem space.

internally, p5.Proc has already the logic to convert from "user" space coordinates to "system" coordinates.

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.