Skip to content

Instantly share code, notes, and snippets.

@shakesoda
Created October 21, 2013 22:21
Show Gist options
  • Save shakesoda/7091943 to your computer and use it in GitHub Desktop.
Save shakesoda/7091943 to your computer and use it in GitHub Desktop.
3d wheel more or less operating
[ScreenSelectMusic]
MusicWheelX=SCREEN_CENTER_X
MusicWheelY=SCREEN_CENTER_Y
MusicWheelOnCommand=draworder,DrawOrder.Overlay;SetDrawByZPosition,true;fov,90
[MusicWheel]
ItemWidth=math.max(math.ceil(SCREEN_WIDTH/3), 220)
ItemHeight=55
ItemOffset=0
ItemTransformFunction=function(self,offsetFromCenter,itemIndex,_numItems) \
local curve = math.pi \
local numItems = 20 \
local radius = 700 \
local y_scale = 1.5 \
local rotationx_radians = scale(offsetFromCenter,-numItems/2,numItems/2,-curve/2,curve/2) \
--[[self:x( math.cos(offsetFromCenter/math.pi))]] \
self:y( math.sin(rotationx_radians/curve) * radius * y_scale) \
self:z( -radius + radius/y_scale*1.5 * math.cos(rotationx_radians) ) \
self:rotationx( rotationx_radians * 180/math.pi ) --[[ to degrees end ]] \
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment