# Another neat project idea hampered by not using a PixelBlaze

**URL:** <https://forum.electromage.com/t/another-neat-project-idea-hampered-by-not-using-a-pixelblaze/1479>\
**Category:** Show and Tell\
**Created:** [August 16, 2021, 6:50pm UTC](https://forum.electromage.com/t/another-neat-project-idea-hampered-by-not-using-a-pixelblaze/1479 "2021-08-16T18:50:24Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [September 2, 2021, 5:01pm UTC](https://forum.electromage.com/t/another-neat-project-idea-hampered-by-not-using-a-pixelblaze/1479/18 "2021-09-02T17:01:24Z")

</div>

> [@ChrisNZ](#):
>
> I guess that’s kicking the can down the road a little since it means all 3D patterns would need to be coded up in terms of polar rather than cartesian coordinates. Definite advantage for supporting the 2D patterns for free though!

Wanted to come back to this, especially since I was playing with @Sunandmooncouture 's map last night.

Because @wizard’s transformation API includes 3D rotation, you can essentially swap any axes for others. So let’s say your led build has something complex, using the [mask](https://forum.electromage.com/t/mapping-complex-objects/1525) as a real world example.

Making the Z axis run essentially horizontal thru the mask makes the mapping simple, but many existing patterns might look better if for example, the X axis was the horizontal axis.

Yes, you could remap everything by changing the mapping code to put the X values where the Z values.are, etc.

Or you could rewrite the render3D to swap x and z values…

Or you could just do a transformation API rotate, and boom, in one or two commands (hint: rotate on the y axis, a 90 degree change will swap X and Z) the entire map is reoriented.

In fact, it’s a good argument why you want all of your axes to be in the same units. So a polar coordinate map fails this, as R is distance and A is an angle. A cylindrical adds Z as a distance, so swapping R and Z is possible (unsure if a rotation can do this, but I’d suspect yes)

A [spherical coordinate system](https://en.m.wikipedia.org/wiki/Spherical_coordinate_system) has the opposite problem, R plus 2 angles.

I need to build a model of a sphere and a cylinder to play with these, now.

But anyway, if you put XYZ coordinates into a map, you can essentially rotate so whichever axis you want (say horizontal along the mask) is where you want it .. so a given pattern does the right thing. So taking a sound reactive pattern which normally does the spectrometer along the X-axis, and the volume/ bar height on the Y… If you wanted the bars to run along the Z, you could easily rotate it with one line, no pattern rewrites needed.

@wizard, consider adding a polar\<-\>cartesian conversion into the API? That would allow rotation in any direction, as well as avoiding the userspace conversion. (to be clearer, you’d have to take 2 axes, one distance and one angle, and convert to 2 distance) which would solve the cylinder issue. (Still pondering the spherical issue… I thought it would require 4d, and it might)

---

_[View the full topic](https://forum.electromage.com/t/another-neat-project-idea-hampered-by-not-using-a-pixelblaze/1479)._
