コード例 #1
0
def build_scene(num_cubes, color_array):
    # Generate positions of each cube
    cube_position_array, barycenter = generate_block_positions(num_cubes)

    # Place cubes
    scene = rtx.Scene(ambient_color=(0, 0, 0))
    for position in cube_position_array:
        geometry = rtx.BoxGeometry(cube_size, cube_size, cube_size)
        geometry.set_position((
            position[0] - barycenter[0],
            position[1] - barycenter[1],
            position[2] - barycenter[2],
        ))
        material = rtx.LambertMaterial(0.3)
        mapping = rtx.SolidColorMapping(random.choice(color_array))
        cube = rtx.Object(geometry, material, mapping)
        scene.add(cube)

    # Place a light
    size = 50
    geometry = rtx.SphereGeometry(size)
    geometry.set_position((size * 2, size * 2, 0))
    material = rtx.EmissiveMaterial(100, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    scene.add(light)

    return scene
コード例 #2
0
def place_objects(scene,
                  colors,
                  max_num_objects=3,
                  min_num_objects=1,
                  discrete_position=False,
                  rotate_object=False):
    # Place objects
    directions = [-1.5, 0.0, 1.5]
    available_positions = []
    for z in directions:
        for x in directions:
            available_positions.append((x, z))
    available_positions = np.array(available_positions)
    num_objects = random.choice(range(min_num_objects, max_num_objects + 1))
    indices = np.random.choice(np.arange(len(available_positions)),
                               replace=False,
                               size=num_objects)
    for xz in available_positions[indices]:
        geometry_type = random.choice(geometry_type_array)
        geometry, offset_y = create_geometry_by_type(geometry_type)
        if rotate_object:
            geometry.set_rotation((0, random.uniform(0, math.pi * 2), 0))
        if discrete_position == False:
            xz += np.random.uniform(-0.3, 0.3, size=xz.shape)

        geometry.set_position((
            xz[0],
            offset_y,
            xz[1],
        ))
        material = rtx.LambertMaterial(0.9)
        color = random.choice(colors)
        mapping = rtx.SolidColorMapping(color)
        obj = rtx.Object(geometry, material, mapping)
        scene.add(obj)
コード例 #3
0
def build_scene(color_array):
    # Generate positions of each cube
    cube_position_array, shift = generate_block_positions(args.num_cubes)
    assert len(cube_position_array) == args.num_cubes

    # Place block
    scene = rtx.Scene(ambient_color=(0, 0, 0))
    for position in cube_position_array:
        geometry = rtx.BoxGeometry(1, 1, 1)
        geometry.set_position((
            position[0] - shift[0],
            position[1] - shift[1],
            position[2] - shift[2],
        ))
        material = rtx.LambertMaterial(0.3)
        mapping = rtx.SolidColorMapping(random.choice(color_array))
        cube = rtx.Object(geometry, material, mapping)
        scene.add(cube)

    # Place lights
    size = 50
    group = rtx.ObjectGroup()
    geometry = rtx.PlainGeometry(size, size)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-10, 0, 0))
    material = rtx.EmissiveMaterial(10, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    group.add(light)

    geometry = rtx.PlainGeometry(size, size)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((10, 0, 0))
    material = rtx.EmissiveMaterial(1, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    group.add(light)

    group.set_rotation((-math.pi / 3, math.pi / 4, 0))
    scene.add(group)

    return scene
コード例 #4
0
def build_scene(floor_textures, wall_textures, fix_light_position=False):
    scene = rtx.Scene(ambient_color=(153 / 255, 226 / 255, 249 / 255))

    texture = load_texture_image(random.choice(wall_textures))
    mapping = generate_texture_mapping(texture, floor_size / wall_height)

    # Place walls
    ## 1
    geometry = rtx.PlainGeometry(floor_size, wall_height)
    geometry.set_rotation((0, 0, 0))
    geometry.set_position((0, wall_height / 2, -floor_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    ## 2
    geometry = rtx.PlainGeometry(floor_size, wall_height)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((floor_size / 2, wall_height / 2, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    ## 3
    geometry = rtx.PlainGeometry(floor_size, wall_height)
    geometry.set_rotation((0, math.pi, 0))
    geometry.set_position((0, wall_height / 2, floor_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    ## 4
    geometry = rtx.PlainGeometry(floor_size, wall_height)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-floor_size / 2, wall_height / 2, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # floor
    geometry = rtx.PlainGeometry(floor_size, floor_size)
    geometry.set_rotation((-math.pi / 2, 0, 0))
    geometry.set_position((0, 0, 0))
    material = rtx.LambertMaterial(0.95)
    texture = load_texture_image(random.choice(floor_textures))
    mapping = generate_texture_mapping(texture, scale=0.5)
    floor = rtx.Object(geometry, material, mapping)
    scene.add(floor)

    # Place a light
    geometry = rtx.SphereGeometry(2)
    spread = floor_size / 2 - 1
    geometry.set_position(
        (random.uniform(-spread, spread), 8, random.uniform(-spread, spread)))
    material = rtx.EmissiveMaterial(20, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    scene.add(light)

    return scene
コード例 #5
0
ファイル: room.py プロジェクト: sxcgc/python-rtx
    texture = np.array(image, dtype=np.float32) / 255
    return texture


grid_size = 7
wall_height = 2
eps = 10
scene = rtx.Scene(ambient_color=(0.5, 1, 1))

# 1
geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
geometry.set_rotation((0, 0, 0))
geometry.set_position((0, 0, -grid_size / 2))
material = rtx.LambertMaterial(0.95)
mapping = rtx.SolidColorMapping((1, 1, 1))
wall = rtx.Object(geometry, material, mapping)
scene.add(wall)

# 2
geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
geometry.set_rotation((0, -math.pi / 2, 0))
geometry.set_position((grid_size / 2, 0, 0))
material = rtx.LambertMaterial(0.95)
mapping = rtx.SolidColorMapping((1, 1, 1))
wall = rtx.Object(geometry, material, mapping)
scene.add(wall)

# 3
geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
geometry.set_rotation((0, math.pi, 0))
geometry.set_position((0, 0, grid_size / 2))
コード例 #6
0
def build_dice(mnist_images):
    assert len(mnist_images) == 6

    dice = rtx.ObjectGroup()

    # 1
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_position((0, 0, 0.5))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[0])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 2
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, -math.pi, 0))
    geometry.set_position((0, 0, -0.5))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[1])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 3
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((0.5, 0, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[2])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 4
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((-0.5, 0, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[3])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 5
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((math.pi / 2, 0, 0))
    geometry.set_position((0, -0.5, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[4])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 5
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((-math.pi / 2, 0, 0))
    geometry.set_position((0, 0.5, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = build_mapping(mnist_images[5])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    dice.set_scale((2, 2, 2))

    return dice
コード例 #7
0
def build_scene(mnist_image_array,
                wall_texture_filename_array,
                floor_texture_filename_array,
                grid_size=8):
    assert len(mnist_image_array) == 6

    wall_height = 3
    eps = 0.1
    scene = rtx.Scene(ambient_color=(0.5, 1, 1))

    texture = load_texture_image(random.choice(wall_texture_filename_array))
    mapping = build_mapping(texture, grid_size / wall_height)

    # 1
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, 0, 0))
    geometry.set_position((0, 0, -grid_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 2
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((grid_size / 2, 0, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 3
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi, 0))
    geometry.set_position((0, 0, grid_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 4
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-grid_size / 2, 0, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # floor
    geometry = rtx.PlainGeometry(grid_size + eps, grid_size + eps)
    geometry.set_rotation((-math.pi / 2, 0, 0))
    geometry.set_position((0, -wall_height / 2, 0))
    material = rtx.LambertMaterial(0.95)
    texture = load_texture_image(random.choice(floor_texture_filename_array))
    mapping = build_mapping(texture, scale=0.5)
    floor = rtx.Object(geometry, material, mapping)
    scene.add(floor)

    # Place lights
    ## Primary light
    primary_light = rtx.ObjectGroup()
    geometry = rtx.SphereGeometry(2)
    material = rtx.EmissiveMaterial(40, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    primary_light.add(light)

    spread = grid_size / 2 - 1
    primary_light.set_position((spread * random.uniform(-1, 1), 8,
                                spread * random.uniform(-1, 1)))
    scene.add(primary_light)

    ## Ambient light
    ambient_lights = rtx.ObjectGroup()

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, 0, 0))
    geometry.set_position((0, 0, -grid_size / 2))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((grid_size / 2, 0, 0))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi, 0))
    geometry.set_position((0, 0, grid_size / 2))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-grid_size / 2, 0, 0))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    ambient_lights.set_position((0, wall_height, 0))
    scene.add(ambient_lights)

    # Place a dice
    dice = build_dice(mnist_image_array)
    spread = grid_size / 3
    dice.set_position((spread * random.uniform(-1, 1), 1 - wall_height / 2,
                       spread * random.uniform(-1, 1)))
    dice.set_rotation((0, random.uniform(0, math.pi * 2), 0))
    scene.add(dice)

    return scene
コード例 #8
0
def build_scene(color_array, wall_texture_filename_array,
                floor_texture_filename_array, grid_size, wall_height):
    eps = 0.1
    scene = rtx.Scene(ambient_color=(0.5, 1, 1))

    texture = load_texture_image(random.choice(wall_texture_filename_array))
    mapping = build_mapping(texture, grid_size / wall_height)

    # 1
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, 0, 0))
    geometry.set_position((0, 0, -grid_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 2
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((grid_size / 2, 0, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 3
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi, 0))
    geometry.set_position((0, 0, grid_size / 2))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # 4
    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-grid_size / 2, 0, 0))
    material = rtx.LambertMaterial(0.95)
    wall = rtx.Object(geometry, material, mapping)
    scene.add(wall)

    # floor
    geometry = rtx.PlainGeometry(grid_size + eps, grid_size + eps)
    geometry.set_rotation((-math.pi / 2, 0, 0))
    geometry.set_position((0, -wall_height / 2, 0))
    material = rtx.LambertMaterial(0.95)
    texture = load_texture_image(random.choice(floor_texture_filename_array))
    mapping = build_mapping(texture, scale=0.5)
    floor = rtx.Object(geometry, material, mapping)
    scene.add(floor)

    # Place lights
    ## Primary light
    primary_light = rtx.ObjectGroup()
    geometry = rtx.SphereGeometry(2)
    material = rtx.EmissiveMaterial(40, visible=False)
    mapping = rtx.SolidColorMapping((1, 1, 1))
    light = rtx.Object(geometry, material, mapping)
    primary_light.add(light)

    spread = grid_size / 2 - 1
    primary_light.set_position(
        (spread * random.uniform(-1, 1), 8, spread * random.uniform(-1, 1)))
    scene.add(primary_light)

    ## Ambient light
    ambient_lights = rtx.ObjectGroup()

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, 0, 0))
    geometry.set_position((0, 0, -grid_size / 2))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((grid_size / 2, 0, 0))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi, 0))
    geometry.set_position((0, 0, grid_size / 2))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    geometry = rtx.PlainGeometry(grid_size + eps, wall_height)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((-grid_size / 2, 0, 0))
    material = rtx.EmissiveMaterial(1, visible=False)
    wall = rtx.Object(geometry, material, mapping)
    ambient_lights.add(wall)

    ambient_lights.set_position((0, wall_height, 0))
    scene.add(ambient_lights)

    # Place objects
    r = grid_size // 4
    r2 = r * 2
    object_positions = generate_object_positions(args.num_objects, r2 - 1)
    for position_index in object_positions:
        geometry_type = random.choice(geometry_type_array)
        geometry = build_geometry_by_type(geometry_type)
        geometry.set_rotation((0, random.uniform(0, math.pi * 2), 0))

        noise = np.random.uniform(-0.125, 0.125, size=2)
        spread = 1.5
        geometry.set_position((
            spread * (position_index[0] - r + 1) + noise[0],
            -wall_height / 2 + 0.5,
            spread * (position_index[1] - r + 1) + noise[1],
        ))
        material = rtx.LambertMaterial(0.9)
        color = random.choice(color_array)
        mapping = rtx.SolidColorMapping(color)
        obj = rtx.Object(geometry, material, mapping)
        scene.add(obj)
    return scene
コード例 #9
0
import geometry as gm
import rtx

scene = rtx.Scene()

box_width = 6
box_height = 5

# 1
geometry = rtx.PlainGeometry(box_width, box_height)
geometry.set_rotation((0, 0, 0))
geometry.set_position((0, 0, -box_width / 2))
material = rtx.LambertMaterial(0.95)
mapping = rtx.SolidColorMapping((1, 1, 1))
wall = rtx.Object(geometry, material, mapping)
scene.add(wall)

# 2
geometry = rtx.PlainGeometry(box_width, box_height)
geometry.set_rotation((0, -math.pi / 2, 0))
geometry.set_position((box_width / 2, 0, 0))
material = rtx.LambertMaterial(0.95)
mapping = rtx.SolidColorMapping((1, 1, 1))
wall = rtx.Object(geometry, material, mapping)
scene.add(wall)

# 3
geometry = rtx.PlainGeometry(box_width, box_height)
geometry.set_rotation((0, math.pi, 0))
geometry.set_position((0, 0, box_width / 2))
コード例 #10
0
def place_dice(scene,
               mnist_images,
               discrete_position=False,
               rotate_dice=False):
    indices = np.random.choice(np.arange(len(mnist_images)),
                               replace=False,
                               size=6)

    dice = rtx.ObjectGroup()

    # 1
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_position((0, 0, 0.5))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[0]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 2
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, -math.pi, 0))
    geometry.set_position((0, 0, -0.5))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[1]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 3
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, math.pi / 2, 0))
    geometry.set_position((0.5, 0, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[2]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 4
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((0, -math.pi / 2, 0))
    geometry.set_position((-0.5, 0, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[3]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 5
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((math.pi / 2, 0, 0))
    geometry.set_position((0, -0.5, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[4]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    # 6
    geometry = rtx.PlainGeometry(1, 1)
    geometry.set_rotation((-math.pi / 2, 0, 0))
    geometry.set_position((0, 0.5, 0))
    material = rtx.LambertMaterial(0.95)
    mapping = generate_texture_mapping(mnist_images[indices[5]])
    face = rtx.Object(geometry, material, mapping)
    dice.add(face)

    dice.set_scale((1.5, 1.5, 1.5))

    directions = [-1.0, 0.0, 1.0]
    available_positions = []
    for z in directions:
        for x in directions:
            available_positions.append((x, z))
    xz = np.array(random.choice(available_positions))
    if discrete_position == False:
        xz += np.random.uniform(-0.25, 0.25, size=xz.shape)
    dice.set_position((xz[0], 0.75, xz[1]))

    if rotate_dice:
        yaw = np.random.uniform(0, math.pi * 2, size=1)[0]
        dice.set_rotation((0, yaw, 0))

    scene.add(dice)
コード例 #11
0
import math
import time
import numpy as np
import rtx
import geometry as gm
import matplotlib.pyplot as plt

scene = rtx.Scene()

# floor
geometry = rtx.PlainGeometry(100, 100)
geometry.set_position((0, 0, 0))
geometry.set_rotation((-math.pi / 2, 0, 0))
material = rtx.LambertMaterial(1.0)
mapping = rtx.SolidColorMapping((1, 1, 1))
floor = rtx.Object(geometry, material, mapping)
scene.add(floor)

# place bunny
faces, vertices = gm.load("../geometries/bunny")
bottom = np.amin(vertices, axis=0)
geometry = rtx.StandardGeometry(faces, vertices, 25)
geometry.set_position((-2.25, -bottom[2], 0))
material = rtx.LambertMaterial(1.0)
mapping = rtx.SolidColorMapping((0, 1, 0))
bunny = rtx.Object(geometry, material, mapping)
scene.add(bunny)

# place teapot
faces, vertices = gm.load("../geometries/teapot")
bottom = np.amin(vertices, axis=0)
コード例 #12
0
ファイル: texture.py プロジェクト: sxcgc/python-rtx
import geometry as gm
import rtx

scene = rtx.Scene((0, 0, 0))

box_width = 6
box_height = 6

# 1
geometry = rtx.PlainGeometry(box_width, box_height)
geometry.set_rotation((0, 0, 0))
geometry.set_position((0, 0, -box_width / 2))
material = rtx.LambertMaterial(0.95)
mapping = rtx.SolidColorMapping((1, 1, 1))
wall = rtx.Object(geometry, material, mapping)
scene.add(wall)

# 2
geometry = rtx.PlainGeometry(box_width, box_height)
geometry.set_rotation((0, -math.pi / 2, 0))
geometry.set_position((box_width / 2, 0, 0))
material = rtx.EmissiveMaterial(1.0)
texture = np.array(Image.open("texture.png"), dtype=np.float32) / 255
uv_coordinates = np.array([
    [0, 1],
    [1, 1],
    [0, 0],
    [1, 0],
], dtype=np.float32)
mapping = rtx.TextureMapping(texture, uv_coordinates)