[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "Blender/Custom Collision"
Jump to navigation
Jump to search
removing signature/credits, standarization and internal links
imported>Qazaaq m (removing search terms that are already present in the article text) |
imported>Qazaaq (removing signature/credits, standarization and internal links) |
||
Line 5: | Line 5: | ||
End Search Terms --> | End Search Terms --> | ||
Alright, there's no good custom collision in Blender tutorial here, so here goes nothing. | Alright, there's no good custom collision in [[Blender]] tutorial here, so here goes nothing. | ||
[http://www.fileplanet.com/files/190000/190119.shtml Resource Pack for this Tutorial] | [http://www.fileplanet.com/files/190000/190119.shtml Resource Pack for this Tutorial] | ||
=About= | ==About== | ||
===What's a Collision Mesh?=== | ===What's a Collision Mesh?=== | ||
Line 16: | Line 16: | ||
===Why Custom?=== | ===Why Custom?=== | ||
Why make custom collision you say? Well, the answer is simple. Because you don't want to walk through your mesh, or have your mesh bounce in mid-air or other weird problems. Sometimes it's ok to just use collision from another | Why make custom collision you say? Well, the answer is simple. Because you don't want to walk through your mesh, or have your mesh bounce in mid-air or other weird problems. Sometimes it's ok to just use collision from another [[Glossary#N|NIF file]], but after following this tutorial, I think you'll be doing a lot more custom collision. I do it all the time, even when it isn't necessary, just because it's more accurate, and takes only about 1 minute to do, without any necessary [[NifSkope]] edits. | ||
==Starting Off== | |||
===Have a Mesh=== | |||
=Starting Off= | |||
==Have a Mesh== | |||
You can't really make your collision mesh until you have a regular mesh, so either make a mesh to use, or download the Tutorial Resources and use those. | You can't really make your collision mesh until you have a regular mesh, so either make a mesh to use, or download the Tutorial Resources and use those. | ||
First, decide what type of collision you want to use. If it's cylindrical, you want to make a Cylinder. If it's a rectangular prism (i.e. mostly squarish or rectangular), then use Box. If it's a sphere, use Sphere. If it's just some odd shape that needs accurate collision, then use either a Static TriangleMesh, or Convex Hull Polytope. | First, decide what type of collision you want to use. If it's cylindrical, you want to make a Cylinder. If it's a rectangular prism (i.e. mostly squarish or rectangular), then use Box. If it's a sphere, use Sphere. If it's just some odd shape that needs accurate collision, then use either a Static TriangleMesh, or Convex Hull Polytope. | ||
===Making the Collision Mesh=== | |||
If you downloaded my resource pack, open '''chapstick.blend''', you want a cylinder. | |||
====Cylinder==== | |||
===Cylinder=== | |||
Make a new cube, as a new object. When you make it, just know that the flat side is pointing toward your camera, so make sure that when you make the cube you are looking at the flat part of your cylinder, like this: | Make a new cube, as a new object. When you make it, just know that the flat side is pointing toward your camera, so make sure that when you make the cube you are looking at the flat part of your cylinder, like this: | ||
Line 52: | Line 44: | ||
[[Image:BlenderCollisionExample4.png]] | [[Image:BlenderCollisionExample4.png]] | ||
===Box=== | ====Box==== | ||
Same as cylinder, but without being round. No need to re-write it all. Just choose box instead of cylinder for bounds. | Same as cylinder, but without being round. No need to re-write it all. Just choose box instead of cylinder for bounds. | ||
Line 58: | Line 50: | ||
There is another way to do it, which I'll explain later. | There is another way to do it, which I'll explain later. | ||
===Sphere=== | ====Sphere==== | ||
For this one, do the same as the cylinder, but don't stretch it. Just fit a cube over your sphere. Choose Sphere instead of Cylinder for bounds. | For this one, do the same as the cylinder, but don't stretch it. Just fit a cube over your sphere. Choose Sphere instead of Cylinder for bounds. | ||
Line 64: | Line 56: | ||
There is another way to do it, which I'll explain later. | There is another way to do it, which I'll explain later. | ||
===Convex Hull Polytope=== | ====Convex Hull Polytope==== | ||
This is a bit different, but almost as easy. Basically, the idea is that you make a regular mesh (do it all in edit mode, makes it easier on you later), and then make it a Convex Hull Polytope, and oblivion recognizes it as collision. This is only for convex shapes, so you can't make something like a sphere with an inward dent, only an outward dent (and certainly not a Harvey Dent). Please note that this may not catch arrows, so if it needs to catch arrows use Static TriangleMesh instead. So, after you make the shape of it in edit mode, go to Object mode, and do set it to only display bounds, but under Draw Extra, also click Wire. | This is a bit different, but almost as easy. Basically, the idea is that you make a regular mesh (do it all in edit mode, makes it easier on you later), and then make it a Convex Hull Polytope, and oblivion recognizes it as collision. This is only for convex shapes, so you can't make something like a sphere with an inward dent, only an outward dent (and certainly not a Harvey Dent). Please note that this may not catch arrows, so if it needs to catch arrows use Static TriangleMesh instead. So, after you make the shape of it in edit mode, go to Object mode, and do set it to only display bounds, but under Draw Extra, also click Wire. | ||
Line 72: | Line 64: | ||
There is another way to do it, which I'll explain later. | There is another way to do it, which I'll explain later. | ||
===Static TriangleMesh=== | ====Static TriangleMesh==== | ||
This one works the same as the Convex Hull Polytope, except this one works for any shape. It does not have to be convex. Use this sparingly though, and keep the vertex count as low as possible, because it could slow down your game | This one works the same as the Convex Hull Polytope, except this one works for any shape. It does not have to be convex. Use this sparingly though, and keep the vertex count as low as possible, because it could slow down your game. The only thing you do differently, is choose Static TriangleMesh instead of Convex Hull Polytope for Bounds. | ||
===The "Other way to do it"=== | ====The "Other way to do it"==== | ||
Make just the mesh shape, and then go to object mode and select it, then go to the scripts window. | Make just the mesh shape, and then go to object mode and select it, then go to the scripts window. | ||
Line 94: | Line 86: | ||
==Export Options== | ==Export Options== | ||
<nowiki>*As of Nif Scripts ver. 2.3.5 | <nowiki>*</nowiki>As of Nif Scripts ver. 2.3.5 | ||
When you export, make sure you've selected all of your mesh objects first. | When you export, make sure you've selected all of your mesh objects first. | ||
Line 104: | Line 96: | ||
Then, change settings according to this: | Then, change settings according to this: | ||
Click on clutter if it's something like a potion, or a bottle, or a food, or something else that just lies around and you can kick and throw and whatnot. | #*Click on clutter if it's something like a potion, or a bottle, or a food, or something else that just lies around and you can kick and throw and whatnot. | ||
#*Click on weapon if it's a weapon. | |||
Click on weapon if it's a weapon. | #*Click on Static if it's something like a building, or a statue. | ||
#*The others are self explanatory. | |||
Click on Static if it's something like a building, or a statue. | #Choose one of the materials (glass, wood, cloth, etc.). If you don't like those, then you have to change it in NifSkope. | ||
Solid and Hollow determines how the physics settings are calculated, choose the one closest to your mesh. | |||
Then just export! | Then just export! | ||
Line 126: | Line 114: | ||
[[Image:BlenderCollisionExample7.png]] | [[Image:BlenderCollisionExample7.png]] | ||
Mass | ; Mass : Makes it heavy or light, big number = heavy. I think this affects how far it will fly through the air when you throw it, and maybe how fast it stops bouncing too. | ||
Linear Damping | ; Linear Damping : I think a higher number means that when it moves, a higher number will make it move slower. | ||
Restitution | ; Restitution : How bouncy it is. Values over about 3 don't seem to affect it. (i.e. 10,000,000 is no bouncier than 10) | ||
Well, good luck making stuff, and I hope this helps. | Well, good luck making stuff, and I hope this helps. | ||
==See Also== | |||
*[http://niftools.sourceforge.net/wiki/Blender/Collision Collision in Blender @ NifTools Wiki] | |||
*[[NifSkope: Adding Collision Model]] | |||
[[Category:Tutorials]] | [[Category:Tutorials]] | ||
[[Category:Modeling_Tutorials]] | [[Category:Modeling_Tutorials]] |