31

To get something like this: Create an icosahedron (20-sided regular solid) and subdivide the faces to get a sphere (see code below). The idea is basically: Create a regular n-hedron (a solid where every face is the same size and every edge is the same length). I use an icosahedron because it's the regular solid with the greatest number of faces. (There's ...


28

On each object you will choose one or more faces that will be removed. In between these faces will be your connection. Select both objects in object mode. Press Ctrl+J to join the objects into one. Then enter edit mode and change to face manipulation mode. Remove the faces that will be joined. Select them and press X, remember to delete faces, not vertices....


22

Triangles, the reason is triangles' ratesrization algorithm is faster, and also natively supported in hardware. So it would be faster to convert one quad into two triangles and do the rasterization. Actually that is what happens when you draw a quad on modern graphics hardware. So the question is what makes it faster ? There are certain characteristics in ...


17

I can't give you a Unity-specific answer (sorry!), but I can tell how I would solve this. I would generate a bunch of points on a circle using the blue vector. First, what is a circle? Well, a circle looks like this: However, graphics hardware can't really draw perfect circles. You're always going to end up with a polygon approximation: We do this ...


17

The best results I've seen for this when a mesh is decimated. Decimating the mesh attempts to reduce the polygon count with minimal shape changes. The decimated meshes retain their shapes fairly well and this would be ideal for non-organic structures like buildings. Though it even works on organic structures as you can see here: There are a few different ...


14

"Cracks" in the geometry mostly. These games have a few things in common, they have gravity and they have collision detection. These anomalies are locations where the collision detection failed in some way. It could have been sharp edges, gaps or a number of other geometry anomalies. Could even been issues with time steps in the physics engine, where the ...


12

To map your texture once on the mesh, your UV coordinates should go from 0..1 over the whole mesh. But depending on the mesh at hand, this can get really tricky. Since it's a plane, this should be simpler. Just look at the plane from it's "up" direction and assign 0,0 to the top left and 1,1 to bottom right. The vertices in between should be fractions. Eg. ...


11

I would try using a hash table for this (for instance, std::unordered_map if you're in C++). Build a hash table that maps from a half-edge (expressed as a pair of indices, in order) to the third index of the triangle the half-edge belongs to. This can be built by simply iterating over the triangle list and adding each triangle's three half-edges to the ...


10

There are three reasons collision margins may exist in physics simulations. As you suggested, a collision margin gives the physics engine some room for error in detecting contacts and resolving contacts, prior to actual penetration. This helps with the appearance of realism as objects do not visibly poke through the ground, etc. There are nuances here for ...


9

The best way in my opinion is to write your own parser for .obj exported with Blender or your preferred 3D modeling software. It will really only take you a maximum of one hour and you won't have to worry about distribution/licence issues. Here is a video about this question: http://youtu.be/izKAvSV3qk0.


9

What you ultimately end up using at runtime is going to be processed version of your exchange formats whether you do it offline or at runtime. The main differences are: If you do it at runtime then you're going to end up paying the processing cost repeatedly and You probably want to spend as little time processing and optimizing as possible so your load ...


9

Your idea is correct, you just have to work more on it. Here is an article I wrote last year: http://blog.meltinglogic.com/2013/12/how-to-generate-procedural-racetracks/ It uses exactly what you described, and as you can see, the result is very good. Here is the code which explains how the mesh was generated from the spline: for(float i = 0; i <= 1.0f;)...


8

What you speak of is called "unwrapping". This is the process of generating UV coordinates for your mesh, so that it will allow UV mapping. UV coordinates are in the range of 0..1, where 0, 0 is the top left of the texture and 1, 1 is the bottom right of the texture. The process of unwrapping a 3D mesh to a 2D surface is something tricky. Imagine a cube. ...


7

From the no-texture picture, I'm pretty sure the problem is that your cube models have inappropriate normals. You need to tell Blender that your cube edges are intended to be sharp, not smooth — what you have now are cubes that are acting like six-sided approximations of spheres. I don't know Blender so I can't tell you exactly how to accomplish this, but ...


7

Alternatively - to provide an easier-to-implement and more efficient solution - one can check the mesh's Euler-Poincaré characteristic. Given the number of vertices V, number of faces F and number of edges E. A triangle mesh is a closed 2-manifold, if and only if V + F - E = 2. If you store your mesh as a list of vertices and indices, V and F can ...


7

vec3 norm = vec3(uViewMatrix * uModelMatrix * aNormal); The normal cannot be transformed like a point, to transform a normal you use the inverse transpose matrix. If you want the fun details of why this is here is a qoute from the OpenGL Red Book that explains it better then I ever will: Mathematically, it's better to think of normal vectors not as ...


7

I am one of the developers of the itSeez3D application you linked in your post. Accidentally stumbled upon your question. @Kevin van der Velden provided an entirely relevant reference here, I would not say it took us five years, but definitely not less than a year :) There are several problems with the simplistic approach you're describing. First of all, ...


6

I have found the solution to this problem of yours. Instead of doing just the following in CreateBoundingBox: BoundingBox result = new BoundingBox(); do this: BoundingBox result = new BoundingBox(); result.Min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); result.Max = new Vector3(float.MinValue, float.MinValue, float.MinValue); When you ...


6

Good day y'all! I've implemented knight666's answer from pseudo-code to Unity-code (C#). Some slight changes were needed but it works like charm, just attach the script to an enemy. I don't know if there are more efficient ways to do some of the things. One thing worth mentioning is that the number of vertices can be reduced from 4*quality to 2*quality+2, ...


6

I think this should answer your question: http://forums.create.msdn.com/forums/p/4751/24616.aspx Basically you should just create a vertex and index buffer yourself (you can wrap them up in a nice class that implements IDrawable ofc). Once you have a vertex and index buffer you can draw your model like in this MSDN article: VertexBuffer vertexBuffer = ...


6

For a triangle with points p0, p1, and p2, and normal n, you’ll need to compare the vectors cross(p1 - p0, p2 - p0) and n. They should either point in the same direction, or in the opposite direction, for all triangles in your mesh. Suppose your convention is that the vectors must point in the same direction. The algorithm is simple. For each triangle, ...


6

Yes it matters but there's no general rule, it depends on the specific scenario and requirements. Here's some hints: 1 Mesh Scenario Pros: Reduce drawcalls(state changes). Cons: No occlusion culling(it's done on a per GameObject resolution in Unity) Potentially time consuming updating the required vertices (depends on the geometry complexity, but for a ...


6

Yes, you can change a mesh at runtime. get the current mesh from your object using Mesh mesh = GetComponent<MeshFilter>().mesh. Alternatively, if you want to replace the mesh with a completely new one, create one with Mesh mesh = new Mesh(); and assign it to your object with GetComponent<MeshFilter>().mesh = mesh; When you intend to modify the ...


6

A texture is a simple idea. You say you've tried some and they didn't look good. If you created the texture out of polygons would it look better? Or better yet, maybe try making the ground a flat plane made out of triangles, but vary the color of the triangles. Either use shades of green, or have both green and brown for grass and dirt, maybe white for ...


5

Luckily, Blender's BMesh support is finally here, as of 2.63. You're looking for the "Knife" tool. See http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.63/BMesh hit K in edit-mode to switch to the knife, and click to set up points to "cut". Spacebar exits knife mode.


5

Let us consider the parametric definition of a sphere: where theta and phi are two incrementing angles, that we will refer to as var t and var u and Rx, Ry and Rz are the independent radii (radiuses) in all three cartesian directions, which, in the case of a sphere, will be defined as one single radius var rad. Let us now consider the fact that the ... ...


5

One example is for light maps. Usually texture space is maximized by overlapping faces which have the same diffuse texture, like the six sides of a crate. With light mapping this would mean that all six sides get the same light and shadow, not to mention it would almost assuredly confuse the light mapper because it can't tell which point in space it should ...


5

I'm not a lawyer, but this is my interpretation: Found in the Terms of Service linked in the footer of the page you linked, this is the notice given to people uploading their content: The Services allow you to submit content, including 3D models in the SketchUp and Keyhole Markup Language (KML) formats. You retain ownership of any intellectual ...


5

I'm assuming you opened the file in Notepad. Notepad doesn't recognize some new line formats. The OBJ format does indeed use newlines as delimiters, and your files likely contain them. It's just not looking that way in Notepad. Try opening them in Notepad++ instead: I'll bet they'll appear correctly. To make sure your parser function works correctly on all ...


Only top voted, non community-wiki answers of a minimum length are eligible