I have two questions.
- 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?
- In the Tutorial Roaming-Ralph, I came across this piece of infomation:
# Set up the environmentThis 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.