48 lines
1.3 KiB
Text
48 lines
1.3 KiB
Text
-- Logo model test: the Singe logotype built by util/textModel.py and converted to glTF by
|
|
-- util/objToGlb.py, turning under a sun with shadows, over the disc.
|
|
local font = fontLoad("Singe/FreeSansBold.ttf", 28)
|
|
local frames = 0
|
|
|
|
fontSelect(font)
|
|
discPlay()
|
|
sceneEnable(true)
|
|
sceneSetBackground(0, 0, 0, 0)
|
|
sceneSetAmbient(70, 70, 80)
|
|
|
|
local logoModel = modelLoad("testScripts/Models/SingeText.glb")
|
|
local logo = modelInstance(logoModel)
|
|
nodeSetPosition(logo, 0, -2.5, 0)
|
|
nodeSetRotation(logo, 0, -30, 0)
|
|
|
|
local stone = materialNew()
|
|
materialSetColor(stone, 120, 120, 130)
|
|
materialSetRoughness(stone, 0.9)
|
|
local floor = nodeNew()
|
|
nodeSetMesh(floor, meshBox(16, 0.2, 10), stone)
|
|
nodeSetPosition(floor, 0, -2.6, 0)
|
|
|
|
local sun = lightNew(LIGHT_DIRECTIONAL)
|
|
nodeSetPosition(sun, -4, 8, 6)
|
|
nodeLookAt(sun, 0, 0, 0)
|
|
lightSetIntensity(sun, 1.6)
|
|
lightSetShadow(sun, true)
|
|
|
|
local camera = nodeNew()
|
|
nodeSetPosition(camera, 0, 2, 13)
|
|
nodeLookAt(camera, 0, 0, 0)
|
|
cameraSet(camera)
|
|
|
|
debugPrint("logo letters " .. #nodeGetChildren(nodeGetChildren(logo)[1]))
|
|
|
|
function onOverlayUpdate()
|
|
frames = frames + 1
|
|
nodeRotate(logo, 0, 0.5, 0)
|
|
overlayClear()
|
|
fontPrint(20, 20, "Logo model, frame " .. frames)
|
|
if frames == 30 or frames == 100 or frames == 170 then
|
|
singeScreenshot()
|
|
end
|
|
if frames == 180 then
|
|
singeQuit()
|
|
end
|
|
end
|