geometry-surface

Way to group coplanar triangles in THREEJS mesh?

南笙酒味 提交于 2019-12-11 01:45:32
问题 I'm working on a modeling tool that lets you directly manipulate meshes. For instance, you can grab a face and drag it around. The user's perception of the "face" could be of more than one coplanar triangle. For instance, the top "face" of a cube would actually be two triangles that get dragged together as one square. To accomplish this, I'd like to collect all coplanar, adjacent faces to any particular triangle for use when dragging. I've looked at Simplifier, as well as this post as

interpolate points on a height map

心已入冬 提交于 2019-12-10 10:46:46
问题 I have some values (bytes) over a plane evenly distributed (the come from real measures) like for instance temperature. I'm trying to generate the whole surface. But I'm not successful. The main condition is that the number and position of the points will not be known and that the surface MUST keep the value in the points where is measured and the points in between will be interpolated. Ideally, if only one point is set the final surface should be a mountain. By the way, and just in the case

How do I draw a texture-mapped triangle in MATLAB?

≡放荡痞女 提交于 2019-12-10 09:44:39
问题 I have a triangle in (u,v) coordinates in an image. I would like to draw this triangle at 3D coordinates (X,Y,Z) texture-mapped with the triangle in the image. Here, u,v,X,Y,Z are all vectors with three elements representing the three corners of the triangle. I have a very ugly, slow and unsatisfactory solution in which I: extract a rectangular part of the image transform it to 3D space with the transformation defined by the three points draw it with surface finally masking out everything

OpenGL Textures form SDLSurface goes too dark

此生再无相见时 提交于 2019-12-10 03:49:10
问题 I've quite the same problem than this OpenGl goes too dark but the answer doesn't work for me. I'm trying to display a image thanks to a surface converted to a texture and the result is too damn dark: Original: after openGL On the left is the original, on the right the OpenGl img. Here's my code: void TexturedRect::draw(int scroll){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glBindTexture(GL_TEXTURE_2D, _texture); glEnable(GL_TEXTURE_2D); glBegin(GL_QUADS); //Begining the cube's drawing

Simulation of ellipse axis

微笑、不失礼 提交于 2019-12-08 09:50:47
问题 I've like to simulate ellipse axis, in my example: a <- x # semi-major axis e <- 1/sqrt(2) # eccentricity b <- a * sqrt(1 - e^2) # semi-minor axis c <- 6.3 # ellipse area My code needs to estimate with 999 replicates a mean major axis (a) when I have the mean eccentricity (e) and differents minor axis (b) and ellipse areas (c). Any idea? Thanks 回答1: a = x b = x * sqrt(1 - e^2) area = pi * x * x * sqrt(1 - e^2) = pi * x^2 * sqrt(1 - e^2) x = sqrt( area / (pi * sqrt(1 - e^2)) ); 来源: https:/

Why does pygame.draw.shape return a Rect?

喜你入骨 提交于 2019-12-08 04:07:33
问题 Although I understand that the purpose of the draw function is to draw to a certain surface, I don't understand why it doesn't simply return a pygame.Surface object that you can later blit to a surface whenever needed. So far this has been very inconvenient when I just want to create a surface and draw it to something else later. Is there any way that you can get similar functions to return a surface object, instead of going that extra step and drawing directly to another surface? 回答1: To

pickle saving pygame Surface (python)

喜欢而已 提交于 2019-12-07 13:40:06
问题 I tried to save a pygame.Surface but it doesn't let me, error TypeError: can't pickle Surface objects I can make it save surfaces? Or maybe there is another module that can save it ? EXPLANATION: a = pygame.Surface( (5,5) ) file = open("hello", "w") pickle.dump(a, file) I have classes which saves in them Surfaces. 回答1: As monkey said: You don't want to pickle a surface. But if you really need to save that surfaces' content than use the pygame.image.save() function. If you prefer your surface

interpolate points on a height map

别来无恙 提交于 2019-12-06 07:01:38
I have some values (bytes) over a plane evenly distributed (the come from real measures) like for instance temperature. I'm trying to generate the whole surface. But I'm not successful. The main condition is that the number and position of the points will not be known and that the surface MUST keep the value in the points where is measured and the points in between will be interpolated. Ideally, if only one point is set the final surface should be a mountain. By the way, and just in the case that it may help. Im coding it on WPF (C#) and it would nice to not involve heavy libraries or whatever

How can I create a triangulated sphere using 'isosurface' function of MATLAB

爱⌒轻易说出口 提交于 2019-12-06 06:07:07
问题 How can I create a Triangulated sphere with faces of triangles with the same area each one. I want something like this, http://imageshack.us/a/img198/5041/71183923.png and I searched and saw I could use the function isosurface of MATLAB, but the triangles don't have equal area and form and they are essentially squares divided in two with the square diagonal. here's my code: >> [X,Y,Z] = meshgrid(-10:10,-10:10,-10:10); >> V = sqrt(X.^2+Y.^2+Z.^2); >> fv = isosurface(X,Y,Z,V) >> p = patch(fv);

How to plot a 3d surface graph in MATLAB?

夙愿已清 提交于 2019-12-06 06:03:22
问题 I have a dataset like so: | 0.1 0.2 0.3 0.4 ---------------------- 1 | 10 11 12 13 2 | 11 12 13 14 3 | 12 13 14 15 4 | 13 14 15 16 I want to plot a 3D surface graph in matlab such that the column headings will be on the y axis, the row headings will be on the x axis and the remaining values will determine the height of the point on the z axis. I have had a look around at lots of different example and I can't work out how to achieve this. At the moment I have got the following: Y = [0.1 0.2 0