0

I have an array of regular hexagons, those hexagons all together cover a surface (equivalent of the surface of my viewport), they are ordered from the center of the surface to the edges, each hexagon is actually an array of vertices (x and y as it's a 2D surface)

using threejs I want to blend two scenes together, some hexagons would show scene A and some would show scene B, and the attribution of which hexagons renders which scene will vary over time (the goal is to transition fully from scene A to scene B), some polygon could alternate between both scenes several time (it's not a fully linear transition but more like keyframed)

I was thinking about generating a grayscale heightmap from my array of hexagons at each frame and use it in a transition shader, so I would have granular control over each polygon and which renders what at each frame, I don't want to draw those multiple heightmaps over an offscreen canvas tho because this would rely on CPU and there would be performance trade off, so I'm looking for the best way to achieve it relying on GPU,

do you have any idea ?

1
  • I believe you can achieve a similar result using an animation library (e.g. GSAP). And, you mentioned that the hexagons are flat 2D elements, are they in a Three.js scene? If yes, then what do you mean by "using threejs I want to blend two scenes together"? They are both in one scene and camera transitions should be enough. Otherwise, it is hard to render multiple scenes in multiple canvases. And after all, how good is your knowledge with Three.js so I can describe my solution(s), if any, properly? And if you can put your code on codesandbox or codepen, that will help a lot Commented Jan 27 at 22:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.