I am not sure I totally understand your question, but one very important use for normals in computer graphics is calculating reflections. For instance, if you're writing a simple raytracer, Lambertian reflectance is quite easy to compute if you know the normal vector where your camera ray intersects a surface....

The solution is simpliest - press Normalize All button in Tools: ...

Finding the minimum distance to each triangle from the point and find the smallest minimum distance from them is the only way. This brute-force method will be very computationally expensive if you have many points to find the closest distance to the triangular mesh (which in turns could contain many...

javascript,three.js,line,intersection,mesh

From Three.js documentation: Ray(origin, direction) origin -- Vector3 The origin of the Ray. direction -- Vector3 The direction of the Ray. So if you have pointA and pointB that are the clicks of the user, you can: (pseudo code) origin = pointA direction = (pointB-pointA).normalize() myRay = THREE.Ray(origin, direction) You...

python,translation,scale,blender,mesh

The first thing you should know is that the vertex positions are in object space - as in distance from the objects origin. You need to use the objects matrix_world to translate that into world space. If you only want the lowest z location to be equal to zero then...

You want to get an MDagPath leading to the transform and then use .extendToShape or .extendToShapeDirectlyBelow() to get the shape node. Then you need to get an MFnMesh from the shape and use that to get to the vertices. Here's the python version, which is all I have handy. Apart...

One aspect to watch out for is the order of transformations. When you specify transformations using the legacy OpenGL matrix stack, they are applied to the vertices in reverse order of the order they are specified in. For example, if you have this sequence: glTranslatef(...); glRotatef(...); This means that vertices...

ios,p2p,mesh,multipeer-connectivity

Check this link for a start. I found it very useful. http://www.appcoda.com/intro-multipeer-connectivity-framework-ios-programming/ There is also Part 2 for this sample in the link....

algorithm,geometry,computational-geometry,mesh,3d-model

If a 3D object is "simple", meaning that it doesn't have holes, it satisfies Euler's Formula for Polyhedra, V - E + F = 2 where V is the number of vertices in the figure, E is the number of edges, and F is the number of faces. If you...

java,javafx,javafx-8,mesh,javafx-3d

One easy solution to make your subscene resize with its parent is just binding its dimensions to those of the parent. For instance: private SubScene createScene3D(Group group) { SubScene scene3d = new SubScene(group, VIEWPORT_SIZE, VIEWPORT_SIZE, true, SceneAntialiasing.BALANCED); scene3d.widthProperty().bind(((AnchorPane)meshGroup.getParent()).widthProperty()); scene3d.heightProperty().bind(((AnchorPane)meshGroup.getParent()).heightProperty()); scene3d.setFill(Color.WHITE); scene3d.setCamera(this.camera);...

You don't want to loop the size of the vertices, but the size of the faces. Your loop should read for (unsigned int i = 0; i < faceIndices.size(); i++) You are looping through the variable faceIndices[i] and I suppose that you want to draw all the triangles, not all...

javascript,three.js,geometry,mesh

You use scale to change the size of your mesh. For example: Mesh.scale.x = 2.5; // WIDTH Mesh.scale.y = 2.5; // HEIGHT Mesh.scale.z = 2.5; // DEPTH ...

android,opengl-es,andengine,mesh,bezier-curve

Ok I found a problem but I dont really understand why it was a problem. So in: float getBezierX(int triangleIndex, float P1X, float PcX, float P2X){ float t = triangleIndex / (triangleCount * 4); float u = 1 - t; float tt = t * t; float uu = u...

You can use the fill function to get the shading that you desire. With a little bit of customization for your application I believe the following code will work, although some vectorization may be in order if the for loop slows your program too much. X = zeros(3,size(TC,1)); Y =...

python,numpy,matplotlib,plot,mesh

Take your output array and: disparray = myarray + (arange(6) * .2)[:,None] plot(X.flatten(), disparray.flatten(), '.') This should do. And, of course you can plot with a for loop. figure() for r in range(myarray.shape[0]): plot(X[0], myarray[r] + 0.2*r, 'k') This uses the X values from the first row of your mesh...

Are you using left-handed view coordinates or right-handed view coordinates in your application (see link)? If you are using left-handed view coordinates, you need to flip the winding of each triangle in the index buffer. assert( (indices.size() % 3) == 0 ); for( auto it = indices.begin(); it != indices.end();...

You're having precision issues because the range of the camera is too high. Try with a smaller range: camera = new THREE.PerspectiveCamera(45, width / height, 1, 1000); Also, change camera.position = new THREE.Vector3(0,-80,850) to camera.position.set(0,-80,850). This pattern may not work in the future....

Assuming you are wanting to only draw the edges, not surfaces: I don't think it's possible to use a line strip to draw all edges of a tetrahedron without drawing at least one of the edges twice. The shape is not complicated enough to justify trying to use a line...

opengl,indexing,textures,mesh,vbo

Yes, you can still gain benefits from IBO. Instead of sharing vertices between block faces, make new vertexes at each block corner, for each face, and assign them different texCoords. This will allow you to have different textures on each block. You'll still be able to share vertices with the...

javascript,three.js,mesh,interactive

Solved it. Actually I wasn't able to loop trough meshes into scene. Didn't know about scene.traverse(). Here's the new code: function onDocumentMouseDown( event ) { event.preventDefault(); mouse.x = ( event.clientX / renderer.domElement.width ) * 2 - 1; mouse.y = - ( event.clientY / renderer.domElement.height ) * 2 + 1; raycaster.setFromCamera(...

While you believe that the problem has nothing to do with storing the objects in a vector, I have a strong feeling that it probably does. The way you are encapsulating OpenGL objects in C++ wrappers is a recipe for pain, and you're probably finding out like many did before...

Open the model in Blender and export it to Roblox's .mesh ==Edit== Sorry, I just pointed at some stuff that i thought would work, but when I tried it I noticed that the add-on was flawed (not much of it was working) so I edited it a bit (it is...

three.js,textures,rendering,mesh

It was a light problem. As I have transparency in my texture material, I used the PhongMaterial. I configured a DirectionalLight to illuminate the scene. For some reason the texture colors were rendered black. I changed the light to AmbientLight and everything was rendered fine.

three.js,shader,mesh,fragment-shader,material

The MeshNormalMaterial basically colors an object based on its normals. So in the equation you gave vNormal is the vertex normal of that fragment. Think of it as translating the (x,y,z) vector of a normal to an (r,g,b) color. The transformation between the two spaces is given by that formula....

You need to turn off backface culling in your shader.

What you're looking for are constructive solid geometry/boolean algorithms with arbitrary meshes. It's considerably more complex than slicing meshes by an infinite plane. Among the earliest and simplest research in this area, and a good starting point, is Constructive Solid Geometry for Polyhedral Objects by Trumbore and Hughes. http://cs.brown.edu/~jfh/papers/Laidlaw-CSG-1986/main.htm From...

javascript,merge,three.js,mesh,fps

Under the hood, using MeshFaceMaterial splits the mesh into separate meshes for each material -- so if you have a separate material for each child mesh, Three.js has to split your combined mesh all the way apart again. As a result, your supposedly merged geometry doesn't actually get sent to...

I managed to do it without passing index buffer to OpenGL with glDrawArrays(GL_TRIANGLES,..) What I did is the following: Fill a vertex array, vertex indices array, normals array and normals indices array. Then I created new vertex and normal arrays with sorted data and passed them to OpenGL. for i...

python,polygon,mesh,maya,vertex

The ugly way is the easy way - if you string split the vertex entries on period you'll get the transform parents. However you can also pass vertex entries to cmds.ls(o=True) which strips off attribute and component names and returns only objects: cmds.select("pCube1.vtx[*]") sel = cmds.ls(sl=True) print sel # [u'pCube1.vtx[0:7]']...

What about this sample? It creates the material array and then adds it to the mesh. So, you could re-use it. Relevant code: // Create an array of materials to be used in a cube, one for each side var cubeMaterialArray = []; // order to add materials: x+,x-,y+,y-,z+,z- cubeMaterialArray.push(...

I modified a bit your code,without anonymous functions and inserting everything within the for loop, I hope its the answer you are looking for. for a clear visualization I linked your rotation axis, so youll allways look to the same angle in each of the 5 subplots. % constants de...

You are using the location for the position and texture coordinate attributes. I think in the code: //Set shader attribute data glEnableVertexAttribArray(VBO_TEXCORD); glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, 0); You meant to pass VBO_TEXCORD for the first argument to glVertexAttribPointer....

data,graphics,cell,visualization,mesh

From my reading I discovered that a mesh define the shape of the cell. For example if I have a rectilinear grid that means my cells will be 3d rectangles, if my grid is a tetrahedral mesh, it means each tetrahedral will present a cell. Shape of the mesh impact...

Mathematically, a surface is parametrized like X=X(u,v), Y=Y(u,v), Z=Z(u,v), where u and v are parameters. In MATLAB terms, the parameters and the vertical and horizontal indices of the matrices X,Y,Z. In your case, you need X,Y,Z to be 200 by 11 matrices. The coordinates in Y and Z are taken...

three.js,position,migration,mesh

position beeing immutable means that the position property can not be changed. so mesh.position = anything; won't work (but you already discovered this) what you can do is not change the position, but you have to change position values. in your case, the easiest way is mesh.position.copy (myVector3); ...

The indexed mesh is, by far, the most popular and used by at least Maya, LW, 3DS Max, and Modo. I'm not sure about XSI and Cinema 4D (haven't looked into their SDKs quite as much). Wings3D uses winged edges, as its name implies, as did Mirai and Nendo from...

ios,unity3d,shader,mesh,particle

You can do it using geometry shaders to create billboarding geometry from each vertex on the GPU. You can then either create the circles as geometry, or create quads and use a circle texture to draw them (I recommend the later). But geometry shaders are not extensively supported yet, even...

matlab,circle,mesh,polar-coordinates

Explanation: Your call to meshgrid is exactly what you want. You just have to generate the data matrix that corresponds to the entries of th and r. Your data depends on the values of r, and as this is a matrix of increasing values in the rows, r = [rho(1),...

Yes, that is possible, but it's a little effortful. With the returning faceIndex you can lookup the three indices of the triangle in the corresponding indexbuffer, which you can resolve to the vertices in the vertexbuffer. These are containing all information you need to compute the normal. Either the face...

matlab,polygon,mesh,finite-element-analysis

I made sth like that: matX = [0,0.2,0; 0.2,0.2,0; 0.2,1,0.2; 1,1,0.2; 0,0.2,0; 0.2,0.2,0; 0.2,1,0.2] matY = [0,0,0.5; 0,0.5,0.5; 0,0,0.5; 0,0.5,0.5; 0.5,0.5,1; 0.5,1,1; 0.5,0.5,1] x = zeros(7,4); y = zeros(7,4); for i=1:7 x(i,:) = [matX(i,1),matX(i,2),matX(i,3),matX(i,1)]; y(i,:) = [matY(i,1),matY(i,2),matY(i,3),matY(i,1)]; plot(x(i,:),y(i,:)) hold on end Mesh: Have anyone better and more sophisticated solution?...

There is a piece of code in CGAL-4.6/demo/Polyhedron/ that permits to load an STL file to a CGAL::Polyhedron_3 object. The demo allows to load an STL file, and then save to an OFF file. Alternatively, if you need to have a STL-loader inside your own code, you might copy-paste and...

mesh,autocad,raytracing,triangulation

You can collect the details of geometry by creating your own implementation of WorlDraw and ViewportDraw with the AutoCAD .NET API: http://adndevblog.typepad.com/autocad/2012/07/get-entity-geometry-using-custom-worlddraw-and-viewportdraw.html

I think its not your points that are rotated, but that the axis does not line up. Try swapping the axis like this: foreach (Vector3 v in vertices) { Vector3 p = lp - v; Gizmos.color = Color.yellow; Gizmos.DrawCube(new Vector3(p.x, p.z, p.y), new Vector3(0.02f, 0.02f, 0.02f)); } Note: I swapped...

Well, a byte is a byte. It can only have 256 different values. There is a slight oddity related to the index range when using Java OpenGL bindings. Since Java does not have unsigned data types, the maximum supported value may seem to be 127. But since the arrays of...

opengl,graphics,computational-geometry,mesh

Try this (OPENGLWIDTH, OPENGLHEIGHT and OPENGLDEPTH are #defines). This scales to fill 90% of the screen (1.8 factor): double xScale = 1.0, xOffset, yOffset, zOffset; double range = maxX - minX; if(range > 0.1) { xScale = 1.8 * OPENGLWIDTH / range; } double yScale = 1.0; range = maxY...

It's most likely either of two things: Your normals are pointing to the backside. To fix this, select the faces with a hard edge and go to the Polygons window menu, Normals -> Reverse. You have hard edge. Select the faces, edges or the whole object and go to the...

javascript,merge,three.js,mesh,material

After a long research I discovered that I was missing an extra parameter for the method 'merge' from the Geometry object, the last parameter is the index of the material that the mesh must have from the materials array, ex: 0 -> first material in 'materials' array... and so on....

python,text,multidimensional-array,blender,mesh

If your sample data matches your file then the basic logic of your loops are out. The logic of your loops depends on all face data being on one line. with open(filepath, 'r') as file: for line in file: # the following is done for each line if not line.startswith('<p>'):...

Ok I fixed it by changing my shader to String vertexShader = "attribute vec4 a_position;\n" + "attribute vec4 a_color;\n" + "attribute vec2 a_texCoord;\n" + "uniform mat4 u_worldView;\n" + "varying vec4 v_color;\n" + "varying vec2 v_texCoords;\n" + "void main()\n" + "{\n" + " v_color = vec4(1, 1, 1, 1);\n" + "...

Since glVertexPointer() (and the other gl<Foo>Pointer() calls) are deprecated in OpenGL 3 and later, I'm assuming that you're not currently using an OpenGL 3+ core profile. There are two methods of instanced rendering which are potentially available, both provided via extensions; ARB_Draw_Instanced and ARB_Instanced_Arrays. Either, both, or neither might be...

javascript,three.js,geometry,mesh,vertices

You can find the geometry in the hierarchy by doing this: object.traverse( function ( child ) { if ( child.geometry !== undefined ) { console.log( child.geometry.vertices ); } } ); ...

3d,mesh,maya,point-clouds,meshlab

The Point Cloud Library has a couple of different command-line tools for turning meshes into point clouds, as far as I know by rendering the object into points from a set of views and combining the renderings. e.g. pcl_mesh2pcd, pcl_mesh_sampling

It looks like your child object is inheriting the scale of the parent object. The way to fix that is to scale the child object by values that will multiply with appropriate parent Game Object's scale values to return the child game object to a scale of 1 1 1....

windows,kinect,mesh,kinect-sdk

3D Face Model Provided by IFTModel Interface The Face Tracking SDK also tries to fit a 3D mask to the user’s face. The 3D model is based on the Candide3 model (http://www.icg.isy.liu.se/candide/) : Note: This model is not returned directly at each call to the Face Tracking SDK, but...

c#,unity3d,mesh,procedural-generation

First of all fix line 1: using UnityEngine; Then, line 4 to create MeshRenderrer component: [RequireComponent(typeof(MeshFilter)), RequireComponent(typeof(MeshRenderer))] Finally, insert to method "Start" code to assign Default material: MeshRenderer mr = GetComponent<MeshRenderer>(); mr.material = new Material(Shader.Find("Diffuse")); Full corrected code: using UnityEngine; using System.Collections; [RequireComponent(typeof(MeshFilter)), RequireComponent(typeof(MeshRenderer))] public class ProceduralMeshScript : MonoBehaviour {...

opengl,3d,mesh,point-clouds,surface

I have now created the point cloud of the shoe but have no idea how to construct the surface of it. How did you construct the point cloud? 3D scan? If so, there are a lot of programs specifically designed for surface reconstruction from point clouds. I suggest you...

c#,unity3d,game-engine,mesh,tile

if you want to scroll uv`s , you can do it by changing the texture offset in Update method , it can be used for background of a 2d game using UnityEngine; using System.Collections; public class ScrollingUVs : MonoBehaviour { public int materialIndex = 0; public Vector2 uvAnimationRate = new...

merge,three.js,geometry,rendering,mesh

Use the matrix4 toolset for translation (and rotation if you want), then merge your geometrys: var geometry = new THREE.TorusGeometry( 11, 0.5, 16, 100 ); var mergeGeometry = new THREE.Geometry(); var matrix = new THREE.Matrix4(); for( i = 1; i <= 50; i++ ) { matrix.makeTranslation( 0, 3.4 * i,...

c++,algorithm,computational-geometry,mesh

There are two main conditions for an edge collapse: Connectivity On each side of the collapsed edge, only one pair of edges must be merged. This can be checked by counting the joint neighbour vertices of the two merging vertices (there must be exactly two). Consider the following example where...

c++,opengl,textures,shader,mesh

It seems that you are not loading the texture. Once loaded, you need to bind it during rendering, using the texture id received when creating the GL texture, like this: glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textureID); About on how to load a texture, there are many tutorials around the web, like this: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/...

c#,unity3d,scripting,monodevelop,mesh

I think it might be the typo at the line for (float i = 0f; i<1f; i=+0.05f) { It should read += not =+ . It is probably getting stuck in an infinite loop because i is never incremented....

mdsumner is correct. For those who might care, here are the basic steps. 1) break each element (e.g., "engine") into a separate array. 2) build a matrix of x,y,z vertices compatible with coords.3d (see rgl documentation) by reading the referenced vertex numbers in each 'engine' row and retrieving the coordinate...

3d,computational-geometry,mesh

You can try an alternative FreeCAD approach. When the problem are the short edges of the glyphs then you can approximate such a multi-edge wire with a single-edge spline. The resulting solid can be filled at will (ok, still dependent on the font and the sizes etc..) Assuming your exampole,...