help for a noob combining bumpmapper.sha to roaming ralph.

I’m trying to combines the two demo-s for
the normil map and the ralphing ralphs!
Is this posebile? this elak svimmat lizard model for
examples is the 98 trillions for the polygones.8)
if i were to say funnel these through to panda,
would the cavern normils snap lös, slapp on it?
is there a tip for me I to you?

Greetings from the swedens!

Also were would i get said normil maps?
would the cavern normil map work with my own persenal sculpturings?
datamaskinen awesome!

Sorry, we need somebody Swedish to read this. I can barely understand what you’re saying.

98 trillions for the polygones

You mean 98 trillion polygons? Wow. In long scale, as is used in Sweden, that would mean 98000000000000000000 polygons… your card cannot handle that at all. You are sure needing some normal maps.

would the cavern normils snap lös, slapp on it? 

Hmm, what do you mean with that? Could you rephrase that in some more sensible english, or use an online translator, which might provide a better translation?

Hahahaha Well hellooo from the swedens, Netherlanders brother!
Thank goodness :open_mouth:
hur går din polygonen manipulationen?
du behov en bättre computern då!8)
I added normal mapping to the roaming ralph though!
This would have saved me a day of frustration yesterday,
if i found this on the forum!
You don’t really appreciate things without a little hard work though.
Now i can load my 37 trillion polygones model through to the panda!
The lights still rotate until i can adjust them better.
Plus you’ll need your own normal mapped tbn egg objects,
(which is a trial in itself, but easier than most)
and place the bumpMapper in the ‘models’ folder.
What an awesome program!

import direct.directbase.DirectStart
from pandac.PandaModules import *
from pandac.PandaModules import WindowProperties
from pandac.PandaModules import Filename,Shader
from pandac.PandaModules import AmbientLight,PointLight
from pandac.PandaModules import CollisionTraverser,CollisionNode
from pandac.PandaModules import CollisionHandlerQueue,CollisionRay
from pandac.PandaModules import TextNode
from pandac.PandaModules import PandaNode,NodePath,Camera,TextNode
from pandac.PandaModules import BitMask32
from pandac.PandaModules import Point3,Vec3,Vec4
from direct.gui.OnscreenText import OnscreenText
from import Actor
from direct.task.Task import Task
from direct.showbase.DirectObject import DirectObject
import random, sys, os, math


# Figure out what directory this program is in.

# Function to put instructions on the screen.
def addInstructions(pos, msg):
    return OnscreenText(text=msg, style=1, fg=(1,1,1,1),
			pos=(-1.3, pos), align=TextNode.ALeft, scale = .05)

# Function to put title on the screen.
def addTitle(text):
    return OnscreenText(text=text, style=1, fg=(1,1,1,1),
	                pos=(1.3,-0.95), align=TextNode.ARight, scale = .07)

class World(DirectObject):

    def __init__(self):
        self.keyMap = {"left":0, "right":0, "forward":0, "cam-left":0, "cam-right":0},0,0,1))

        # Post the instructions

        self.title = addTitle("Panda3D Tutorial: Roaming Ralph (Walking on Uneven Terrain)")
        self.inst1 = addInstructions(0.95, "[ESC]: Quit")
        self.inst2 = addInstructions(0.90, "[Left Arrow]: Rotate Ralph Left")
        self.inst3 = addInstructions(0.85, "[Right Arrow]: Rotate Ralph Right")
        self.inst4 = addInstructions(0.80, "[Up Arrow]: Run Ralph Forward")
        self.inst6 = addInstructions(0.70, "[A]: Rotate Camera Left")
        self.inst7 = addInstructions(0.65, "[S]: Rotate Camera Right")
        # Set up the environment

        self.environ = loader.loadModel("models/world")      

        # Create the main character, Ralph

        ralphStartPos = self.environ.find("**/start_point").getPos()
        self.ralph = Actor("models/tbn_hell3.egg",

#####more delete

        props = WindowProperties()

        # Add a light to the scene.
        self.lightpivot = render.attachNewNode("lightpivot")
        plight = PointLight('plight')
        plight.setColor(Vec4(1, 1, 1, 1))
        plnp = self.lightpivot.attachNewNode(plight.upcastToPandaNode())
        plnp.setPos(30, 60, 30)
        self.ralph.setShaderInput("light", plnp)

        # Add an ambient light
        alight = AmbientLight('alight')
        alight.setColor(Vec4(0.2, 0.2, 0.2, 1))
        alnp = render.attachNewNode(alight.upcastToPandaNode())

        # create a sphere to denote the light
        sphere = loader.loadModel("models/sphere")

#####new shader
        self.shader = Shader.load("models/bumpMapper.sha") 
        self.shaderenable = 1

        # Create a floater object.  We use the "floater" as a temporary
        # variable in a variety of calculations.
        self.floater = NodePath(PandaNode("floater"))

        # Accept the control keys for movement and rotation

        self.accept("escape", sys.exit)
        self.accept("arrow_left", self.setKey, ["left",1])
        self.accept("arrow_right", self.setKey, ["right",1])
        self.accept("arrow_up", self.setKey, ["forward",1])
        self.accept("a", self.setKey, ["cam-left",1])
        self.accept("s", self.setKey, ["cam-right",1])
        self.accept("arrow_left-up", self.setKey, ["left",0])
        self.accept("arrow_right-up", self.setKey, ["right",0])
        self.accept("arrow_up-up", self.setKey, ["forward",0])
        self.accept("a-up", self.setKey, ["cam-left",0])
        self.accept("s-up", self.setKey, ["cam-right",0])

        # Set the current viewing target
        self.focus = Vec3(48,0,25)
        self.heading = 180
        self.pitch = 0
        self.mousex = 0
        self.mousey = 0
        self.last = 0
        self.mousebtn = [0,0,0]


        # Game state variables
        self.prevtime = 0
        self.isMoving = False

        # Set up the camera
        # We will detect the height of the terrain by creating a collision
        # ray and casting it downward toward the terrain.  One ray will
        # start above ralph's head, and the other will start above the camera.
        # A ray may hit the terrain, or it may hit a rock or a tree.  If it
        # hits the terrain, we can detect the height.  If it hits anything
        # else, we rule that the move is illegal.

        self.cTrav = CollisionTraverser()

        self.ralphGroundRay = CollisionRay()
        self.ralphGroundCol = CollisionNode('ralphRay')
        self.ralphGroundColNp = self.ralph.attachNewNode(self.ralphGroundCol)
        self.ralphGroundHandler = CollisionHandlerQueue()
        self.cTrav.addCollider(self.ralphGroundColNp, self.ralphGroundHandler)

        self.camGroundRay = CollisionRay()
        self.camGroundCol = CollisionNode('camRay')
        self.camGroundColNp =
        self.camGroundHandler = CollisionHandlerQueue()
        self.cTrav.addCollider(self.camGroundColNp, self.camGroundHandler)

        # Uncomment this line to see the collision rays
        #Uncomment this line to show a visual representation of the 
        #collisions occuring

    #Records the state of the arrow keys
    def setKey(self, key, value):
        self.keyMap[key] = value

    # Accepts arrow keys to move either the player or the menu cursor,
    # Also deals with grid checking and collision detection
    def move(self, task):

        elapsed = task.time - self.prevtime

        # If the camera-left key is pressed, move camera left.
        # If the camera-right key is pressed, move camera right.
        camright =
        if (self.keyMap["cam-left"]!=0):
   - camright*(elapsed*20))
        if (self.keyMap["cam-right"]!=0):
   + camright*(elapsed*20))

        # save ralph's initial position so that we can restore it,
        # in case he falls off the map or runs into something.

        startpos = self.ralph.getPos()

        # If a move-key is pressed, move ralph in the specified direction.

        if (self.keyMap["left"]!=0):
            self.ralph.setH(self.ralph.getH() + elapsed*300)
        if (self.keyMap["right"]!=0):
            self.ralph.setH(self.ralph.getH() - elapsed*300)
        if (self.keyMap["forward"]!=0):
            backward = self.ralph.getNetTransform().getMat().getRow3(1)
            self.ralph.setPos(self.ralph.getPos() - backward*(elapsed*5))

        # If ralph is moving, loop the run animation.
        # If he is standing still, stop the animation.

        if (self.keyMap["forward"]!=0) or (self.keyMap["left"]!=0) or (self.keyMap["right"]!=0):
            if self.isMoving is False:
                self.isMoving = True
            if self.isMoving:
                self.isMoving = False

        # If the camera is too far from ralph, move it closer.
        # If the camera is too close to ralph, move it farther.

        camvec = self.ralph.getPos() -
        camdist = camvec.length()
        if (camdist > 10.0):
   + camvec*(camdist-10))
            camdist = 10.0
        if (camdist < 5.0):
   - camvec*(5-camdist))
            camdist = 5.0

        # Now check for collisions.


        # Adjust ralph's Z coordinate.  If ralph's ray hit terrain,
        # update his Z. If it hit anything else, or didn't hit anything, put
        # him back where he was last frame.

        entries = []
        for i in range(self.ralphGroundHandler.getNumEntries()):
            entry = self.ralphGroundHandler.getEntry(i)
        entries.sort(lambda x,y: cmp(y.getSurfacePoint(render).getZ(),
        if (len(entries)>0) and (entries[0].getIntoNode().getName() == "terrain"):

        # Keep the camera at one foot above the terrain,
        # or two feet above ralph, whichever is greater.
        entries = []
        for i in range(self.camGroundHandler.getNumEntries()):
            entry = self.camGroundHandler.getEntry(i)
        entries.sort(lambda x,y: cmp(y.getSurfacePoint(render).getZ(),
        if (len(entries)>0) and (entries[0].getIntoNode().getName() == "terrain"):
        if ( < self.ralph.getZ() + 2.0):
   + 2.0)
        # The camera should look in ralph's direction,
        # but it should also try to stay horizontal, so look at
        # a floater which hovers above ralph's head.
        self.floater.setZ(self.ralph.getZ() + 2.0)

        # Store the task time and continue.
        self.prevtime = task.time
        return Task.cont

    def controlCamera(self, task):
        # figure out how much the mouse has moved (in pixels)
        md =
        x = md.getX()
        y = md.getY()
        if, 100, 100):
            self.heading = self.heading - (x - 100)*0.2
            self.pitch = self.pitch - (y - 100)*0.2
        if (self.pitch < -45): self.pitch = -45
        if (self.pitch >  45): self.pitch =  45,self.pitch,0)
        dir =
        elapsed = task.time - self.last
        if (self.last == 0): elapsed = 0
        if (self.mousebtn[0]):
            self.focus = self.focus + dir * elapsed*30
        if (self.mousebtn[1]) or (self.mousebtn[2]):
            self.focus = self.focus - dir * elapsed*30 - (dir*5))
        if ( < -49.0):
        if ( >  49.0): 49)
        if ( < -49.0):
        if ( >  49.0): 49)
        if ( <   1.0):  1)
        if ( >  49.0): 49)
        self.focus = + (dir*5)
        self.last = task.time
        return Task.cont
if (
    w=addTitle("Normal Map Demo: Video driver reports that shaders are not supported.")

ok, congrats i guess.

Thanks! 37 trillion for the polygones,
a treat for your eyeballs,
with it this will!