question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to convert grids to Cube with pixijs

See original GitHub issue

Hi, First of all, thanks for this plugin. I need a little help with converting coordinate systems from cartesian to cube. I am using this example, https://jsfiddle.net/Flauwekeul/qmfgey44/

So I converted the point variable using the toCube method but it doesn’t seem to work. Any help would be greatly appreciated. Here’s the fiddle i am using: https://jsfiddle.net/qmfgey44/306/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
flauwekeulcommented, Oct 26, 2018

hex.toCube(hex) returns the 3 cube coordinates of the passed hex. hex.toCube(hex.toPoint()) (like you had before) should also work. A hex instance is already a “point-like”, so just passing a hex instance to toCube() is enough.

You can also get the 3 cube coordinates separately using: hex.q, hex.r and hex.s.

What do you want to do with the cube coordinates?

0reactions
MahmoodBawazircommented, Nov 9, 2018

hey @flauwekeul, sorry for the late response. Thank you, that solved my problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PIXI.CubeResource - PixiJS API Documentation
Collection of URLs or resources to use as the sides of the cube. options, ICubeResourceOptions, <optional>. ImageResource options.
Read more >
Convert THREE.js Shader to PIXI.js - Stack Overflow
There is not need to convert the GLSL code. You can use exactly the same shader. Just crate a PIXI.Filter and set the...
Read more >
pixijs-grid - npm
You can run npm install pixijs-grid or simply clone this repository and use the code from dist . Add pixijs-grid.js (from src/ )...
Read more >
Building an Images Gallery using PixiJS and WebGL
Creating the grid background with a WebGL Shader ... let's see how we can add the desired effect (Cubic Lens Distortion) to the...
Read more >
PIXI.Bounds
void, addVertices(transform: PIXI.Transform, vertices: Float32Array, beginOffset: number, endOffset: number) ; void, addVerticesMatrix(matrix: PIXI.Matrix, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found