Skip to content

Instantly share code, notes, and snippets.

@freem
Forked from shakesoda/metrics.ini
Created October 21, 2013 22:21
Show Gist options
  • Save freem/7091946 to your computer and use it in GitHub Desktop.
Save freem/7091946 to your computer and use it in GitHub Desktop.
my 3d wheel transform from syszero ssc special
[ScreenSelectMusic]
MusicWheelX=WideScale(SCREEN_CENTER_X+132,SCREEN_CENTER_X+144)
MusicWheelY=SCREEN_CENTER_Y+4
MusicWheelOnCommand=SetDrawByZPosition,true;fov,45;rotationy,20;
[MusicWheel]
NumWheelItems=17
# 3.9 metrics I use in the wheel transform:
ItemCurveX=20
ItemSpacingY=44
Wheel3DRadius=200
CirclePercent=0.45
ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) \
local curve3D = THEME:GetMetric("MusicWheel", "CirclePercent")*2*math.pi \
local fRotX = scale(offsetFromCenter, -THEME:GetMetric("MusicWheel","NumWheelItems")/2,THEME:GetMetric("MusicWheel","NumWheelItems")/2, -curve3D/2,curve3D/2) \
local radius = THEME:GetMetric("MusicWheel","Wheel3DRadius") \
local curveX = THEME:GetMetric("MusicWheel","ItemCurveX") \
local spacingY = THEME:GetMetric("MusicWheel","ItemSpacingY") \
self:x( (1-math.cos(offsetFromCenter/math.pi))*curveX ) \
self:y( (offsetFromCenter*scale(math.abs(offsetFromCenter), 0,THEME:GetMetric("MusicWheel","NumWheelItems")/2, spacingY,spacingY*0.625)) ) \
self:z( -15*math.abs(offsetFromCenter*2.5) ) \
self:rotationx((offsetFromCenter*13) * math.sin(180/math.pi)) \
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment