import scene import plane import sphere import cylinder import donut import box import repeated2d import transform import light import material import csg import roundedge cam = camera.FreeCamera(bdgmath.Vector3(5, -8, 6), bdgmath.Vector3(0, 0, 0.75)) scene = scene.Scene() scene.addLight(light.DirectionalLight(bdgmath.Vector3(-1, 0.5, -4), 0.8)) scene.addLight(light.AmbientLight(0.2)) floor = plane.ZPlane(0) floor.squareSize = 2 scene.addObject(floor) disk = roundedge.RoundEdge(0.1, cylinder.CappedCylinder(0.8, 3.8)) translatedDisk = transform.Translate3d(bdgmath.Vector3(0, 0, 1.5), disk) #scene.addObject(translatedDisk)
import scene import plane import sphere import cylinder import donut import box import repeated2d import transform import light #cam = camera.YCamera(0, -5, 3) #cam.setViewDistance(2) #cam.setViewWidth(2) cam = camera.FreeCamera(bdgmath.Vector3(10, -8, 6), bdgmath.Vector3(0, 0, 5)) scene = scene.Scene() scene.addLight(light.DirectionalLight(bdgmath.Vector3(-1, 1, -4), 0.8)) scene.addLight(light.AmbientLight(0.2)) scene.addObject(plane.ZPlane(0)) #scene.addObject(plane.ZPlane(-2)) #scene.addObject(sphere.Sphere(bdgmath.Vector3(-0.1, 0, 2.5), 2.5)) s2 = sphere.Sphere(bdgmath.Vector3(3.5, 2, 2), 2) s2.color1 = (40, 200, 40) #s2.color2 = (0, 250, 0) s2.color2 = (40, 200, 40) #scene.addObject(s2)
import camera import scene import plane import sphere import cylinder import donut import box import repeated2d import transform import light import material import csg import roundedge cam = camera.FreeCamera(bdgmath.Vector3(8, -12, 10), bdgmath.Vector3(-2, 8, 0.75)) scene = scene.Scene() scene.addLight(light.DirectionalLight(bdgmath.Vector3(-1, 0.5, -4), 0.8)) scene.addLight(light.AmbientLight(0.2)) floor = plane.ZPlane(0) floor.squareSize = 2 scene.addObject(floor) disk = roundedge.RoundEdge(0.1, cylinder.CappedCylinder(0.8, 3.8)) translatedDisk = transform.Translate3d(bdgmath.Vector3(0, 0, 1.5), disk) #scene.addObject(translatedDisk)
import camera import scene import plane import sphere import cylinder import donut import box import repeated2d import transform import light import material import csg cam = camera.FreeCamera(bdgmath.Vector3(8, -12, 8), bdgmath.Vector3(0, 0, 5)) scene = scene.Scene() scene.addLight(light.DirectionalLight(bdgmath.Vector3(-1, 0.5, -4), 0.8)) scene.addLight(light.AmbientLight(0.2)) floor = plane.ZPlane(0) floor.squareSize = 2 scene.addObject(floor) cube = box.Box(bdgmath.Vector3(5, 5, 5)) cube.color = (1.0, 0.75, 0.25) negSphere = sphere.Sphere(bdgmath.Vector3(2.5, -2.5, 2.5), 4.5)
import bdgmath import camera import scene import plane import sphere import cylinder import donut import box import repeated2d import transform import light import material cam = camera.FreeCamera(bdgmath.Vector3(3, -7, 10), bdgmath.Vector3(0, 0, 4)) scene = scene.Scene() scene.addLight(light.DirectionalLight(bdgmath.Vector3(-1, 0.5, -4), 0.8)) scene.addLight(light.AmbientLight(0.2)) floor = plane.ZPlane(0) floor.squareSize = 2 scene.addObject(floor) s = sphere.Sphere(bdgmath.Vector3(0, 0, 4), 2) s.material = material.Reflect( (0.4, 0.4, 0.4), # base color 0.5, # kR the amount of reflected light to use 0.3, # kD the amount of diffuse light to use