Skip to content
/ cubes Public

RGBCMY Cubes πŸ”΄πŸŸ’πŸ”΅πŸ©΅πŸ©·πŸ’›

License

Notifications You must be signed in to change notification settings

jo-m/cubes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RGBCMY Cubes πŸ”΄πŸŸ’πŸ”΅πŸ©΅πŸ©·πŸ’›

python3 -m http.server 8000
open http://localhost:8000

screenshot

Color-to-rotation mapping

The achievable colors form an octahedron in RGB space (vertices at R, G, B, C, M, Y, centered at gray). To find the rotation for a target color:

  1. Gamut projection β€” a ray from the octahedron center (0.5, 0.5, 0.5) through the target color is intersected with the gamut surface. The hit point's barycentric coordinates encode which faces should be visible and in what proportion.

  2. View direction β€” the barycentric weights, signed by the octant of the hit face, give the local-frame view direction that produces the desired color mix.

  3. Rotation β€” Rodrigues' formula builds the minimum-arc rotation aligning the view direction with the camera, giving the final model matrix.

About

RGBCMY Cubes πŸ”΄πŸŸ’πŸ”΅πŸ©΅πŸ©·πŸ’›

Topics

Resources

License

Stars

Watchers

Forks