Hello, with Panda3D can i create platene ?
If you are away from the world I would like a simple sphere with a texture
But if I am close I would add relief, using a heightmap I guess ?
can i apply heightmap relief in sphere surface ?
Hello, with Panda3D can i create platene ?
If you are away from the world I would like a simple sphere with a texture
But if I am close I would add relief, using a heightmap I guess ?
can i apply heightmap relief in sphere surface ?
Yes you can create planets with panda!
The trick I use is I don’t use a sphere but a cube. I use a shader to morph the cube into a sphere. I then apply a height map to the sides of the “cube” for my terrain.
There are other ways to do it too.
if i use cube, physic and collision are cube not sphere ?
i see example here :
But i want to not use egg model for “simulate” sphere.
for shere i see this :
panda3d.org/manual/index.ph … _Texturing
but i have not code example
i want to like this : youtube.com/watch?v=345lLB0hhe8
people to help me?
Here is a script to help you make any shape in panda.
Here is some example code (I’m doing this from memory so it might be wrong):
from procedural import IcoSphere
planet = Icosphere(radius=1, subdivisions=3)
planet.repartentTo(render)
thank you but your code not work for me.
I have a blank gray window
this is my code :
import direct.directbase.DirectStart
import procedural
model = procedural.IcoSphere(radius=1, subdivisions=3)
model.reparentTo(render)
base.run()
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