tessellation

Algorithm for a geodesic sphere

南笙酒味 提交于 2021-02-06 05:39:55
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Algorithm for a geodesic sphere

风格不统一 提交于 2021-02-06 05:38:09
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Algorithm for a geodesic sphere

↘锁芯ラ 提交于 2021-02-06 05:36:06
问题 I have to make a sphere out of smaller uniformely distributed balls. I think the optimal way is to build a triangle-based geodesic sphere and use the vertices as the middle points of my balls. But I fail to write an algorithm generating the vertices. Answer in C++ or pseudo-code will be better. Example of a geodesic sphere: http://i.stack.imgur.com/iNQfP.png 回答1: Using the link @Muckle_ewe gave me, I was able to code the following algorithm: Outside the main() class Vector3d { // this is a

Get all points within a triangle is causing an overflow

蓝咒 提交于 2019-12-20 05:46:16
问题 Well I'm lacking GraphicsPath in Unity (to fills polygon, draw them with and outline and utilities with shapes in general), so I'm doing my own implementation of it. Well, we could debate also which is the best option, but actually, I prefer this because I'm learning a lot. The idea is the following, given a polygon, we do an offset polygon (inwards and outwards) with ClipperLib, and later with LibTessDotNet we triangulate it, outputing this: Green, blue and yellow pixels are the sides of

Drawing tessallated LineLoops in OpenGL/GLSL

只愿长相守 提交于 2019-12-14 03:56:22
问题 I am rendering some LineLoops on a sphere (borders on a planet) and want to tessallate them into shorter lines to prevent long lines clipping into the sphere. Example: Here is my current source code: C++ draw call: void Border::Draw() const { glBindVertexArray(_vao); glPatchParameteri(GL_PATCH_VERTICES, 2); glDrawArrays(GL_PATCHES, 0, _size); glBindVertexArray(0); } Vertex Shader: #version 400 in layout(location = 0) vec3 position; void main() { gl_Position = vec4(position, 1.0); }

Tessellation Shader - OpenGL

柔情痞子 提交于 2019-12-11 01:39:39
问题 layout (vertices = 3) out; void main(void) { if (gl_InvocationID == 0) { gl_TessLevelInner[0] = 5.0; gl_TessLevelOuter[0] = 5.0; gl_TessLevelOuter[1] = 5.0; gl_TessLevelOuter[2] = 5.0; } gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; } Excerpt From: Haemel, Nicholas. “OpenGL SuperBible: How can i understand TessLevelInner and Outer and why is the id 0 listed two times? 回答1: How can I understand gl_TessLevelInner and gl_TessLevelOuter ? Please see: gl_TessLevelInner,

GLSL/OpenGL shader tessellation flickering and failure

久未见 提交于 2019-12-04 16:39:19
问题 I just started with OpenGL tessellation and have run into a bit a trouble. I am tessellating series of patches formed by one vertex each. These vertices/patches are structured in a gridlike fashion to later form a terrain generated by Perlin Noise. The problem I have run into is that starting from the second patch, and every 5 th patch after that, sometimes have a lot of tessellation (not the way i configured) but most of the time it doesn't get tessellated at all. Like so: The two white

OpenGL ES - How to Draw a filled Polygon?

不想你离开。 提交于 2019-11-30 12:51:57
问题 I tried googling and searching on stack but I didn't find anything :-( ( Mapping irregular shapes or other polygons (cartoons, sprites) to triangles in OpenGL ES ) I want to draw a filled polygon in OpenGL ES on iPad (2D, don't need 3D) (I'm new to OpenGL && OpenGL ES) It seems simple on OpenGL but with ES with just can draw triangle. But I can't find any good tutorial about this :-( Does it exist any wrapper / library or anything else that could help me ? I don't want to use CoreGraphics ,

OpenGL ES - How to Draw a filled Polygon?

自古美人都是妖i 提交于 2019-11-30 04:01:20
I tried googling and searching on stack but I didn't find anything :-( ( Mapping irregular shapes or other polygons (cartoons, sprites) to triangles in OpenGL ES ) I want to draw a filled polygon in OpenGL ES on iPad (2D, don't need 3D) (I'm new to OpenGL && OpenGL ES) It seems simple on OpenGL but with ES with just can draw triangle. But I can't find any good tutorial about this :-( Does it exist any wrapper / library or anything else that could help me ? I don't want to use CoreGraphics , it's too slow for what I'm doing ^^ And if possible, avoiding too (big) library like Cocos2D. Edit :

Math for a geodesic sphere

送分小仙女□ 提交于 2019-11-28 17:33:44
I'm trying to create a very specific geodesic tessellation, but I can't find anything online about it. It is normal to subdivide the triangles of an icosahedron into triangle patches and project them onto the sphere. However, I noticed an animated GIF on the Wikipedia entry for Geodesic Domes that appears not to follow this scheme. Geodesic spheres generally comprise a mixture of mostly hexagonal triangle patches, with pentagonal patches forming at the vertices of the original icosahedron; in most cases, these pentagons are linked together; that is, following a straight edge from the center of