ventana = Window:Create()
lienzo = Context:Create( ventana )
mundo = World:Create()
local sol = DirectionalLight:Create()
sol:SetRotation(90, 0, 0 )
local camara = Camera:Create()
local suelo = Model:Box()
suelo:SetScale(5, 0.2, 5 )
suelo:SetPosition( 0, -1, 5 )
suelo:SetPickMode(0)
local punto = Model:Cone()
punto:SetPosition ( 0, 0, 5 )
punto:SetColor ( 1, 0, 0 )
punto:SetPickMode(0)
while true do
if mundo:Pick(0, 10, 5,0, -10, 5, PickInfo(),1.0, true ) then
return false
end
if ventana:Closed() then return false end
Time:Update()
mundo:Update()
mundo:Render()
lienzo:Sync()
end
Hi, I'm trying to understand lightning, but this doesn't work, from my perspective I create a lightning bolt from the red cone to the ground, and if it collides I expect the program to close.
What am I doing wrong?