# Snowboarding Physics (really basic)

Hi all,

I’m not-so-new to blender, and know my way around the interface, but I’ve only just started using the game engine.

I’ve started making a little snowboarding demo in my free time, and I’ve rigged up a really simplistic man, and parented one of his feet to a snowboard.

I’ve really got two questions, and the first I’m sure will be easily answered by you guys! The second… maybe, maybe not.

1. How do I get him to stay on the ground?! Which object/armature (or empty, I guess) do I enable physics for? Or do I enable physics? :spin: Help on this would really be appreciated.

Once there, I reckon I could get him to slide, which leads me on to

1. How do I get him to turn realistically (carving)? This really baffles me, as previously the only physics I’ve done is with balls and guns and such. I assume python’s involved somewhere but my knowledge of blender’s logic bricks is hazy, to say the least, and my only knowledge of scripting whatsoever is a weeny bit of actionscript.

Here’s my .blend,

If someone more knowledgeable than I could take the time to explain this to me a little, I would be very grateful!

To be annoying and bump my thread to the top again, I’ll just say my first question has been solved; for anyone who wants to know, you make everything except the empty a ghost, and make the empty dynamic, and hey presto!

So what I’d really like now is some advice on No. 2. I’m not asking for any categorical answers, but some helpful pointers wouldn’t go amiss!

Thanks,

Thinking about this, I think your best way of doing this is to have an empty that always faces downhill (with the align to normal script elsewhere on this forum). Parent your character to the empty and have them able to rotate. You then have two vectors: the way the character is facing and downhill. You then add a blend of these two vectors to the empty’s current velocity/direction. What percentage of each you use is based on how much the character is turning.

There are some other complications such as that obviously a steeper hill needs to move the character faster than a shallow slope, and that you need to have the force of the slope vector transfer to the character direction vector when the character turns, but that’s where I’d start.

Hope that was suitably confusing.

As far as I understand this, a good way to simulate the fall line would be to have the empty dynamic, so it falls down the slope like a ball, and calculate the vector like so (in maths, as I don’t know any python):

``````Position 1 (last frame) = (x,y,z)
Position 2 (current frame) = (x',y',z')
Unit vector = ((x'-x),(y'-y),(z'-z))/sqrt((x'-x)^2+(y'-y)^2+(z'-z)^2)
``````

This would probably have to be converted into rotation as well.
That would be more realistic than simply calculating it from the slope, I think.

You then have two vectors: the way the character is facing and downhill. You then add a blend of these two vectors to the empty’s current velocity/direction. What percentage of each you use is based on how much the character is turning.

Yeah, that makes sense. So the snowboarder’s rotation tends towards the fall line.

There are some other complications such as that obviously a steeper hill needs to move the character faster than a shallow slope, and that you need to have the force of the slope vector transfer to the character direction vector when the character turns, but that’s where I’d start.

I knew this was going to involve python somewhere… Sounds like I’m going to need to make my turning keys change some “leaning” variable, as rotation and torque are too generalised to cut it.

Thanks a lot for your tips!