vertices

Leaflet - draw polyline vertices only

假如想象 提交于 2019-12-04 17:38:17
The title is quite clear, I'm using Leaflet and I need to show only the vertices of a polyline. For exemple see this image : Currently I can only have the black line, I'd like only the red squares. Using markers is not an option for performance issue, my lines can be huge (500 000 vertices) and the use of smoothFactor is a need. Is that possible? If not, does someone knows a plugin that does that, or have a hint on how could I do that by extending the Polyline class? What you could do here is every time the polyline gets rendered, get the segments of it's SVG path, use those points to add SVG

Three.js - Merge multiple geometries/meshes removing common areas

拜拜、爱过 提交于 2019-12-04 13:51:27
问题 I´m trying to merge two geometries/meshes (red and blue) into a unique one. But after creating a new geometry and applying geometry.merge() I found that all the inner vertices and faces are still there (the green area). I would like to remove all that extra information, as it generates visual glitches on the rendered faces and also I cannot calculate the merged volume correctly.. I need something like on the last picture, a single mesh that only includes the minimal external/outer faces and

Three.js - Merge multiple geometries/meshes removing common areas

流过昼夜 提交于 2019-12-03 08:57:12
I´m trying to merge two geometries/meshes (red and blue) into a unique one. But after creating a new geometry and applying geometry.merge() I found that all the inner vertices and faces are still there (the green area). I would like to remove all that extra information, as it generates visual glitches on the rendered faces and also I cannot calculate the merged volume correctly.. I need something like on the last picture, a single mesh that only includes the minimal external/outer faces and vertices, removing the inner ones. I tried applying ThreeCSG to subtract meshes but I´m founding that it

UnProjected mouse coordinates are between 0-1

一个人想着一个人 提交于 2019-12-02 16:10:04
问题 I'm trying to create a ray from my mouse location out into 3D space, and apparently in order to do that I need to "UnProject()" it. Doing so will give me a value between 0 & 1 for each axis. This can't be right for drawing a "Ray" or a line from the viewport, can it? All this is, is a percentage essentially of my mouse to viewport size. If this is actually right, then I don't understand the following: I draw triangles that have vertices that are not constrained from 0-1, rather they are

Three.js: Get updated vertices with morph targets

ⅰ亾dé卋堺 提交于 2019-12-01 22:45:17
I've got some morph targets working: https://jsfiddle.net/3wtwzuh3/2/ (Use the slider control to see the morph) However, I'd like to be able to access the new positions of the vertices after the morph. If you notice in the linked example, I am displaying the y coordinate of the first vertex of the cube and it is not updating! // This Y vertex doesn't seem to update! elInfo.innerHTML = geometry.vertices[0].y; Is it possible to get the new positions? I've tried setting all sorts of flags and have had no luck. Thanks! Please note this example is just for the purposes of the question, it's a

Sorting an Array of X and Y Vertice Points ? iOS / Objective C [closed]

允我心安 提交于 2019-12-01 04:11:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I have a Core Data entity called Line. Each line contains an instance of a VerticePoint which contains an x and y property. These x and y vertices form simple 2D polygons. What I want to do is sort an array of these Line objects which is in random order so that the origin of the shape, the bottom

Can I delete a float array when I have used glBufferData?

*爱你&永不变心* 提交于 2019-12-01 00:47:42
I'm studying OpenGL API and I would like to ask you if I can delete a float array of vertices after passing it to OpenGL. Example code: GLuint VBO; float *vertices = new float[2]; vertices[0] = 0.0f; vertices[1] = 1.0f; glGenBuffers(1, &VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); delete[] vertices; Could you tell me consequences about doing it? Yes, absolutely. After the glBufferData() call returns, you can do anything you want with the data. Overwrite it, delete it, etc. The consequence is that the OpenGL implementation

Modifying OpenGL axis system

会有一股神秘感。 提交于 2019-11-29 15:53:08
问题 I'm using OpenGL with gluPerspective, what would I need to do to make it use an axis-system which the origin is top left instead of bottom left? 回答1: I would say direct operating on the projection matrix is a clean way for this operation. But if by any chance you need an alternative: You can just use glScalef(1.f, -1.f, 1.f) to flip the axis. This is also just an operation on the GL_MODELVIEW or GL_PROJECTION matrix (whatever is currently active). 回答2: You can do this by flipping the y -axis

three js vertices does not update

戏子无情 提交于 2019-11-29 11:15:33
问题 I'm using three.js r67, and vertices does not seem to be updated. I set geometry.dynamic = true , geometry.verticesNeedUpdate = true . Circle is moving, but line is static.... Someone could help me? var scene = new THREE.Scene(); var renderer = new THREE.WebGLRenderer(); var g = new THREE.CircleGeometry( 4, 16 ); var m = new THREE.MeshBasicMaterial({color: 0x114949}); var circle = new THREE.Mesh( g, m ); circle.position.x = 2; circle.position.y = 2; circle.position.z = -1; scene.add( circle )

Use of Vertex Array Objects and Vertex Buffer Objects

╄→гoц情女王★ 提交于 2019-11-28 16:23:17
I am trying to understand these two, how to use them and how they are related. Let's say I want to create a simple terrain and a textured cube. For both objects I have the array of triangles vertices and for the cube I have an array containing the texture's data. My question is: how do I use VAOs and VBOs to create and render these two? Would I have to create a VAO and VBO for each object? or should create a VAO for each object's VBO (vertices, texture data, etc.)? There are many tutorials and books but I still don't get the very idea of how these concepts must be understood and used.