how to apply terrain to my sphere ?
from __future__ import print_function
import os
import sys
from panda3d.core import Vec3, load_prc_file_data, ShaderTerrainMesh
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
import threading
from threading import Thread
import procedural
class Application(ShowBase):
def __init__(self):
ShowBase.__init__(self)
model = procedural.IcoSphere(radius=1, subdivisions=3)
model.reparentTo(self.render)
heightfield = loader.loadTexture("resources/heightfield.png")
terrain_node = ShaderTerrainMesh()
terrain_node.heightfield = heightfield
terrain_node.target_triangle_width = 6.0
terrain_node.generate()
terrain_n = model.attach_new_node(terrain_node)
Application().run()
i have sphere and “terrain”, but the terrain appear next to shere and i have cube