Example #1
0
def gen_sphere(
        pos=np.array([0, 0, 0]), radius=0.01, rgba=[1, 0, 0,
                                                    1], subdivisions=2):
    """
    :param pos:
    :param radius:
    :param rgba:
    :return:
    author: weiwei
    date: 20161212tsukuba, 20191228osaka
    """
    sphere_trm = trihelper.gen_sphere(pos, radius, subdivisions)
    sphere_sgm = StaticGeometricModel(sphere_trm)
    sphere_sgm.set_rgba(rgba)
    return sphere_sgm
Example #2
0
import numpy as np
import basis.trimesh_generator as tg
import modeling.geometric_model as gm
import visualization.panda.world as wd

if __name__ == '__main__':
    base = wd.World(cam_pos=np.array([.3,.3,.3]), lookat_pos=np.zeros(3))
    tg_sphere = tg.gen_sphere(pos=np.zeros(3), radius=.05)
    gm_sphere = gm.GeometricModel(tg_sphere)
    gm_sphere.attach_to(base)
    base.run()