turning and collision mesh

I have two questions.

  1. I am using these simple codes found in one of the BVW Scripting Tutorials, for turning my model.
self.accept("arrow_left",self.turn,[-1])
self.accept("arrow_right",self.turn,[1])

def turn(self,dir):
pandaTurn = self.panda.hprInterval(.2,Vec3(self.panda.getH()-(10*dir),0,0))
    pandaTurn.start()

The model turns, but only one degree per key-press. I want the model to turn until the button is released. Likewise in walking forward.
I noticed that the Tutorial Roaming-Ralph accomplishes just what I want. However the coding is a bit complicated for me.
I’m guessing the same can be accomplished using the coding from the BVW Scripting Tutorials, but I am sure it will require a little math, which I am not all that good at.
Can someone help me with a simple code for rotating my model, and moving it forward continuosly until the key is released?

  1. In the Tutorial Roaming-Ralph, I came across this piece of infomation:
    # Set up the environment

    This environment model contains collision meshes. If you look

# in the egg file, you will see the following:
#
#    <Collide> { Polyset keep descend }
#
# This tag causes the following mesh to be converted to a collision
# mesh -- a mesh which is optimized for collision, not rendering.
# It also keeps the original mesh, so there are now two copies ---
# one optimized for rendering, one for collisions.  

How does one look in the egg file, and how does one tag a mesh to be converted to a collision mesh. Thanks

How do I create a button that holds it position in the corner of the screen, doesn’t rotate or move, even though all other objects in the scene move and rotate, including the camera - sort of like a gui, only instead of a 2d image, its a 3d clickable object? Thanks.

WOW!
49 views, and NO replies!
Amazing!
This has never happened to me in all the forums that I have ever been on.
I guess I am playing with the big boys now.
So I need to stop posting silly questions, and do my own research.
OK. I will. I’ll search every topic on the forum which deals with the topic I want to know about. It’s a lot of searching, but I’ll do it, even if it takes me the whole night on my slow internet connection.
THANKS VERY MUCH PEOPLES. :slight_smile:

Solution to your first problem:

self.dir=0.0
self.speed=10.0 #adjust it if you need
self.accept("arrow_left",self.turn,[-1])
self.accept("arrow_right",self.turn,[1])
self.accept("arrow_left-up",self.turn,[0])
self.accept("arrow_right-up",self.turn,[0])
taskMgr.add(self.turnTask,"i'm tina!")

def turnTask(self,task):
  if(self.dir!=0):
    self.panda.setH(self.panda,task.dt*self.dir*self.speed)
def turn(self,dir):
  self.dir=dir

I didn’t test it, but it should work.
change self.speed if you need it slower or faster.

I will check out the code tonight, but I just want to thank you for responding.
I found infomation on collision mesh. Thanks