Difference between revisions of "Blender/Custom Collision"
Jump to navigation
Jump to search
Updated to the latest version of Blender with plugins. Tried to improve readability and added some more explanations.
imported>DragoonWraith (→Making the Collision Mesh: no need to link repeatedly) |
imported>Bruneauinfo (Updated to the latest version of Blender with plugins. Tried to improve readability and added some more explanations.) |
||
Line 5: | Line 5: | ||
End Search Terms --> | End Search Terms --> | ||
==Introduction== | |||
If you've decided you'd like to make custom objects for Oblivion using Blender (weapons, armor, furniture, buildings, etc) at some point you will realize the need to implement what is called a Collision Mesh to make your items behave naturally within the game world. This article introduces a basic method through simple examples for making custom collision meshes. | |||
===What's a Collision Mesh?=== | ===What's a Collision Mesh?=== | ||
A collision mesh tells the game how objects interact with each other in the game world. What happens when an object bumps into another object? Do they swing and bounce? Is an object solid and unmovable? Can an object fall, float, roll, etc. Without a collision mesh there is no collision which means objects, like the player, can pass right through them. Without a collision mesh your creations won't be affected by gravity and can't be touched. So if you want your work to be useful in the game you'll need to learn the simple process of creating collision meshes in Blender. | |||
===Why Custom?=== | ===Why Custom?=== | ||
Why make custom collision | Why make custom collision meshes? Is it possible to reuse collision meshes from another object? Certainly collision meshes can be reused from other objects. However, the process of making collision meshes yourself is pretty simple. Properly sized and shaped collision meshes will reduce or eliminate clipping. Knowing how they are made means you can customize your collision mesh specifically for your project. You'll also have a much easier time troubleshooting problems should they arise in testing your mods in the game. | ||
=====Notes===== | |||
* Custom collisions do not ''require'' [[NifSkope]] edits. | |||
==Prerequisites== | |||
This article of course assumes you've installed Blender and know how to use the software. If not then you need to go here first : [http://www.tesnexus.com/downloads/file.php?id=12248 TESNexus] Follow the installation instructions exactly for your OS. Once you gain some [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro experience using Blender] return to this article. | |||
This article also includes a resource pack. You may find it handy if you're relatively new to Blender : [http://www.fileplanet.com/190119/190000/fileinfo/Oblivion---Blender-Havok-Tutorial-UESP-Resource-Pack Tutorial Resources] | |||
==Making the Collision Mesh== | |||
==== | ====Open a Mesh in Blender==== | ||
Specifically you need an object mesh from the resource pack listed above - open '''chapstick.blend''' in Blender. You won't be able to create your collision mesh until you have an object mesh that needs one. | |||
The type of collision you use will be based on the shape of your object mesh as well as what your object represents in the game world. If your object is the inside of a room, for example, you would want your collision mesh to be slightly smaller than your object mesh. Otherwise objects might clip into the wall. If on the other hand your object is a stone wall or a sword you will want your collision mesh to be slightly larger than the object mesh so objects don't clip into it. | |||
Another consideration is the shape of your object mesh. If your object is a cylinder (like the tube of ChapStick in the example below) you'll want to make a Cylinder collision mesh. If your object is a rectangular prism - mostly squarish or rectangular - then you'll use a Box. If it's a sphere, then a Sphere. However, if it's an odd shape that needs accurate collision you'll use a Static TriangleMesh. | |||
=====Notes===== | |||
*You should give your object mesh a name in the Object Panel under Objects and Links. The two meshes could very well look almost identical in Blender. Naming your object mesh (and later your collision mesh) will help cut down on confusion when you're wondering if you've selected the correct one during an edit operation. | |||
*Along with the above note it's also a good idea to open an Outliner window for a similar reason. | |||
==== | ====The Collision Mesh==== | ||
This may sound a little counterintuitive, but a cylindrical collision starts out in the shape of a cube. In Blender create a cube as a new object. The photo below shows the cube just created being positioned over the end of the ChapStick cylinder which appears in the photo as a circle. This is precisely where you want it. <br /><br /> | |||
[[Image:BlenderCollisionExample1.png]] | |||
<br /> The goal is to encapsulate the tube of ChapStick inside the cube by extruding the cube over the body of the ChapStick cylinder and then resizing the cube so it fits snuggly. <br /><br /> | |||
[[Image:BlenderCollisionExample2.png]] | |||
==== | =====Notes===== | ||
*The faces of the cube are opaque in the picture. The next photo gives a little more insight into how the Chapstick tube should be positioned within the cube. | |||
====Create the Collision==== | |||
When you're happy with your collision mesh go to a Buttons Window in Blender and select the Object Panel (or Press F7 while hovering your mouse in a Buttons Window) | |||
Under '''Draw>Drawtype''' select '''Bounds'''. Under '''Draw>Draw Extra''' you will see a select box with the default setting set to '''Box'''. Since the ChapStick tube is in the shape of a cylinder you will want to select '''Cylinder'''. Do this now. | |||
<br /><br /> | |||
[[Image:BlenderCollisionExample3.png|680px|]]<br /> | |||
====Other Collision Shapes==== | |||
The steps for other shapes are for the most part identical to the example above. The only difference would be what you selected under '''Draw>Draw Extra'''. If your object was a box you would select '''Box'''. If your object was a sphere you would select '''Sphere'''. A pyramid like shape would use '''Pyramid'''. | |||
====Static TriangleMesh==== | |||
There is at least one other option for creating your collision mesh using what's called Static TriangleMesh. | |||
Similar to the steps above you make a low-poly version of your object mesh to use as the collision mesh. Optimally, it should fit over your object mesh as smoothly as possible. Just don't use too many polygons, or it will slow down your game. Next, in the Object Panel under '''Draw>Drawtype''' set drawmode to Bounds, and set the select box to '''Polyheder'''. Under '''Draw Extra''' choose '''Wire'''.<br /><br /> | |||
[[Image:BlenderCollisionStaticMeshExample1.png]] | |||
==Export Options== | ==Export Options== | ||
Line 81: | Line 86: | ||
Set up your export options like this: | Set up your export options like this: | ||
[[Image:BlenderCollisionExample6.png]] | [[Image:BlenderCollisionExample6.png |680px|]] | ||
Then, change settings according to this: | Then, change settings according to this: |