Skip to content
Discussion options

You must be logged in to vote

The error says "destination error bad dimensions"

From the error and looking at the cube, I can tell you need to set the canvas size to something that is a power of 2.

Ensuring that the canvas texture has the same width and height should fix the error.

In the original code,

There is a constant set for the texture size.

Line 13: const canvasSize = 512;

and the canvas size is set in a useEffect in GridBox

Starts on Line 95

  useEffect(() => {
    const canvas = canvasRef.current;
    canvas.width = canvasSize;
    canvas.height = canvasSize;
  });

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bellem3re
Comment options

@mwmwmw
Comment options

@bellem3re
Comment options

@mwmwmw
Comment options

Answer selected by bellem3re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants