Hello I would like to understand how to display textures with renderPipeline
without renderPipeline i have a plane with a correct texture
from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
import os, sys
import logging
from direct.showbase.ShowBase import ShowBase
from panda3d.core import (
loadPrcFileData,
Vec3,
Point3,
DirectionalLight,
VBase4,
AmbientLight,
CollisionTraverser,
CollisionPlane,
CollisionBox,
CollisionNode,
Plane,
BitMask32,
# For building Bullet collision geometry
Geom,
GeomTriangles,
GeomVertexFormat,
GeomVertexData,
GeomVertexWriter)
from panda3d.bullet import (
BulletWorld,
BulletDebugNode,
BulletPlaneShape,
BulletRigidBodyNode,
BulletGhostNode,
BulletTriangleMesh,
BulletTriangleMeshShape,
BulletHelper)
from panda3d.physics import ForceNode, LinearVectorForce
from direct.interval.IntervalGlobal import Sequence, Wait
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
# setup the camera
self.disableMouse()
self.camera.setPos(0., -250., 130.)
self.camera.setHpr(0., -30., 0.)
# create the plane
cm = CardMaker("plane")
# set the size of the card (left, right, bottom, top - in XZ-plane)
cm.setFrame(-100., 100., -100., 150.)
self.plane = self.render.attachNewNode(cm.generate())
# the card is created vertically in the XZ-plane, so it has to be rotated
# to make it horizontal
self.plane.setP(-90.)
road_tex = self.loader.loadTexture("texture.jpeg")
self.plane.setTexture(road_tex)
app = MyApp()
app.run()
but with render Pipeline
from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
import os, sys
import logging
from direct.showbase.ShowBase import ShowBase
from panda3d.core import (
loadPrcFileData,
Vec3,
Point3,
DirectionalLight,
VBase4,
AmbientLight,
CollisionTraverser,
CollisionPlane,
CollisionBox,
CollisionNode,
Plane,
BitMask32,
# For building Bullet collision geometry
Geom,
GeomTriangles,
GeomVertexFormat,
GeomVertexData,
GeomVertexWriter)
from panda3d.bullet import (
BulletWorld,
BulletDebugNode,
BulletPlaneShape,
BulletRigidBodyNode,
BulletGhostNode,
BulletTriangleMesh,
BulletTriangleMeshShape,
BulletHelper)
from panda3d.physics import ForceNode, LinearVectorForce
from direct.interval.IntervalGlobal import Sequence, Wait
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
pipeline_path = "../../"
if not os.path.isfile(os.path.join(pipeline_path, "setup.py")):
pipeline_path = "../../RenderPipeline/"
sys.path.insert(0, pipeline_path)
from rpcore import RenderPipeline, SpotLight
self.render_pipeline = RenderPipeline()
self.render_pipeline.create(self)
self.render_pipeline.daytime_mgr.time = "7:40"
# setup the camera
self.disableMouse()
self.camera.setPos(0., -250., 130.)
self.camera.setHpr(0., -30., 0.)
# create the plane
cm = CardMaker("plane")
# set the size of the card (left, right, bottom, top - in XZ-plane)
cm.setFrame(-100., 100., -100., 150.)
self.plane = self.render.attachNewNode(cm.generate())
# the card is created vertically in the XZ-plane, so it has to be rotated
# to make it horizontal
self.plane.setP(-90.)
road_tex = self.loader.loadTexture("texture.jpeg")
self.plane.setTexture(road_tex)
app = MyApp()
app.run()
i lost my texture why ?
and can i apply a reflection in my plane object (like a wet surface)