How to convert grids to Cube with pixijs
See original GitHub issueHi, 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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hex.toCube(hex)
returns the 3 cube coordinates of the passedhex
.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 totoCube()
is enough.You can also get the 3 cube coordinates separately using:
hex.q
,hex.r
andhex.s
.What do you want to do with the cube coordinates?
hey @flauwekeul, sorry for the late response. Thank you, that solved my problem.