Coder Social home page Coder Social logo

Comments (3)

Ahlecss avatar Ahlecss commented on June 3, 2024

Oh and the most important !

As i'm working on Next, I use React-curtains, is it aligned with V8 of Curtains.js ? I believe it's the major cause on why my planes are not updating (I mean, because it's not reactive)

Have a nice day !

from curtainsjs.

martinlaxenaire avatar martinlaxenaire commented on June 3, 2024

Hi @Ahlecss,

well, that's a lot of questions.

It's a bit difficult to figure out what you're trying to do exactly, especially without a minimal code example. Let me try to clear things out a bit.

  1. Except for very specific use cases (such as having multiple webgl layers with HTML content between them), you should always use one and only one canvas and webgl context.
  2. There's an official example on how to use the lib with a smooth scroll library. I haven't tried Locomotive scroll v5 but there's no reason the concept wouldn't be the same.
  3. The lib is taking care internally of what plane should or shouldn't be drawn based on frustum culling (see this example and play with the various transform values). If you're messing with the vertices positions in your shader, considering using the drawCheckMargins property.
  4. It's up to you to decide what various onRender callback to use. Plane.onRender callbacks are useful to update things relative to the plane itself, such as its uniforms or transform values. Curtains.onRender is just called once at each requestAnimationFrame tick. There's nothing wrong in putting conditional statements in there.
  5. react-curtains should use the latest curtainsjs version. If that's not the case, then you could fill a bug in the appropriate repo.

Hope that helps.

Cheers,

from curtainsjs.

Ahlecss avatar Ahlecss commented on June 3, 2024

Thanks for all your replies !

  1. I manage to do it on only one canvas, even if I needed in fact multiple webgl layers with HTML content between them (playing on transparency shader), because perf are more important.
  2. Thanks, Loco works great.
  3. I understand, but I have one more question : Is there any Raycast-like feature on Curtainsjs ? I would like to fire an event when I hover a plane, but I don't really move the plane, I move the vertexPosition.x, assuming that playing with vertex needs less calculation that moving with plane.relativeTranslation.x, and then call curtains.needRender (and maybe plane.updatePosition ?), is that the case ?
  4. Thanks for the precise response !
  5. Same thing !

Have a nice day !

from curtainsjs.

Related Issues (20)

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.