Skip to content

Commit

Permalink
temp: debug figure variants
Browse files Browse the repository at this point in the history
  • Loading branch information
akorzunin committed Aug 20, 2024
1 parent 68128e5 commit c344238
Showing 1 changed file with 7 additions and 72 deletions.
79 changes: 7 additions & 72 deletions src/models/icosahedron/components/Variants.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,6 @@ class_name IcosahedronVarints
const dst := 0.794
const l := 0.577

## 20 faces 12 vert 30 egdes
# quad -> rect
const figure_variants_v2 = {
'111' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'011' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'010' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'110' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'101' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'001' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'000' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
'100' = {
'111' = Vector4( l, l, l, dst),
'110' = Vector4( l, l, l, dst),
'011' = Vector4( l, l, l, dst),
'101' = Vector4( l, l, l, dst),
},
}
# 3 golden rectangles
# rect x
# rect y
# rect z
# to define eash face we ned to know what cartesian quadrant it belongs
# and what rectangle it touches (can be 2 or all)
# RX have normal (1,0,0) and so on
enum GoldenRect {RX, RY, RZ}
# so each rect can be represented as vector
# and we can use them in conmbinations also

# RX + RY = (1,1,0)


static func get_face( rects: Array[GoldenRect], quad: Vector3i):
if len(rects) == 3:
return figure_variants_v2[quad]['111']
pass


const figure_variants = {
8: {
name = "top_left",
Expand Down Expand Up @@ -114,3 +42,10 @@ const figure_variants = {
name = "default",
},
}

# TDOO: make in sync w/ UV map from discrete_control.tscn
var figure_variants_v2 := {
0: Quaternion().normalized(),
1: FaceLock.left_q.normalized(),
# ...
}

0 comments on commit c344238

Please sign in to comment.