@tactfulgamer Here’s a simple example of moving things around using the sliders.
PS. There’s going to be a lot more code to do what your video does.
function setup()
parameter.integer("c1x",-50,50,0)
parameter.integer("c1z",-50,50,0)
parameter.integer("c2x",-50,50,20)
parameter.integer("c2z",-50,50,20)
parameter.integer("p1x",-45,45,20)
assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")
scene = craft.scene()
v=scene.camera:add(OrbitViewer, vec3(0,0,0), 200, 0, 600)
v.rx,v.ry=20,20
createFloor()
createWall1()
createWall2()
createRect1()
createRect2()
createPic1()
print("Slide print window down")
end
function draw()
update(DeltaTime)
scene:draw()
end
function update(dt)
scene:update(dt)
c1.position=vec3(c1x,0,c1z)
c2.position=vec3(c2x,0,c2z)
p1.position=vec3(p1x,15,49)
end
function createFloor()
f1=scene:entity()
f1.position=vec3(0,-5,0)
f1.model = craft.model.cube(vec3(100,1,100))
f1.material = craft.material("Materials:Standard")
f1.material.map = readImage("Blocks:Wood Red")
end
function createWall1()
f1=scene:entity()
f1.position=vec3(50,10,0)
f1.model = craft.model.cube(vec3(1,30,100))
f1.material = craft.material("Materials:Standard")
f1.material.map = readImage("Blocks:Trunk White Side")
end
function createWall2()
f1=scene:entity()
f1.position=vec3(0,10,50)
f1.model = craft.model.cube(vec3(100,30,1))
f1.material = craft.material("Materials:Standard")
f1.material.map = readImage("Blocks:Dirt")
end
function createRect1()
c1=scene:entity()
c1.position=vec3(0,0,0)
c1.model = craft.model.cube(vec3(10,10,10))
c1.material = craft.material("Materials:Standard")
c1.material.map = readImage("Blocks:Trunk White Top")
end
function createRect2()
c2=scene:entity()
c2.position=vec3(30,0,30)
c2.model = craft.model.cube(vec3(10,10,10))
c2.material = craft.material("Materials:Standard")
c2.material.map = readImage("Blocks:Fence Stone")
end
function createPic1()
p1=scene:entity()
p1.position=vec3(10,15,49)
p1.model = craft.model.cube(vec3(8,12,1))
p1.material = craft.material("Materials:Standard")
p1.material.map = readImage("Blocks:Error")
end