graphics

Why do vertex normals flip after rotating 3D point cloulds?

蹲街弑〆低调 提交于 2019-12-24 05:17:11
问题 I have two samples of 3D point cloud of human face. The blue point cloud denote target face and the red point cloud indicates the template. The image below shows that the target and template face are aligned in different directions (target face roughly along x-axis, template face roughly along y-axis). Figure 1: The region around the nose is displayed in Figure 1. I want to rotate my target face (blue face) with nasal tip as the center of rotation (I translated the target to the template

Rotated 2d rectangle intersection detection

柔情痞子 提交于 2019-12-24 05:03:27
问题 I have 2 rectangles they are placed arbitrarily and I have rects all four corner point like struct Rect { NSPoint topLeft; NSPoint topRight; NSPoint bottomLeft; NSPoint bottomRight; } I want to check whether 2 rectangles intersects. I am looking a method similar to NSIntersectsRect . But NSIntersectsRect won't respect the rotation of rectangle. The points in structure are the points obtained after rotation. Sample code in Objecitve-C ,C++ or C will be a great help. 回答1: One simple way is to

API's similar to GLUTesselator? [closed]

99封情书 提交于 2019-12-24 04:53:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm looking for an API that is open sourced and that can take contours of verticies as input and return verticies of triangles. I would also like it to support different winding rules. Thanks 回答1: OpenSceneGraph has a GLU style tesselator, see http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs

Embedding dendrogram in Java

蹲街弑〆低调 提交于 2019-12-24 04:46:05
问题 I'm looking for a library capable of drawing dendrograms of data in Java (not calculating them, I can do it by myself).. do you have any clues? Already tried to search it over Google but haven't found anything that is not stand-alone (while I need to embed the generation inside my program). Thanks! 回答1: Check out the JUNG graph library. It won't perform the actual clustering for you but is a really good library for visualising your results. 回答2: Take a look at Archaeopteryx. It has fairly

OutOfMemoryException on drawing wide lines with WinForms

≯℡__Kan透↙ 提交于 2019-12-24 04:35:55
问题 This one is crazy. I just draw a couple of thousands of lines in OnPaint handler. There is no problem, when pen.Width <= 1 , or when there aren't many lines on the screen. OK, I draw a scaled map. Line width scales with the map. When I zoom SOME maps, I get OutOfMemoryException . WHY?! When I set pen.Width to 1 - no problem. When I set it to correspond tracks widths - some maps draw OK, some throw the exception AT CERTAIN ZOOM LEVELS. What's going on? It's has NOTHING to do with actual memory

Displaying simple bitmap on Android

狂风中的少年 提交于 2019-12-24 04:31:29
问题 beginner in graphics here! I'm trying to display a simple image on my device, but nothing appears, and the log doesn't show any bug. The program runs but nothing happens. Here is my code protected void onDraw(Canvas canvas) { canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.droid_1), 10, 10, null); } and the cal of this method public void run() { Canvas canvas; long tickCount = 0; Log.d(TAG, "starting game loop"); while (running) { canvas = null; //try locking the

Displaying simple bitmap on Android

谁说我不能喝 提交于 2019-12-24 04:31:04
问题 beginner in graphics here! I'm trying to display a simple image on my device, but nothing appears, and the log doesn't show any bug. The program runs but nothing happens. Here is my code protected void onDraw(Canvas canvas) { canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.droid_1), 10, 10, null); } and the cal of this method public void run() { Canvas canvas; long tickCount = 0; Log.d(TAG, "starting game loop"); while (running) { canvas = null; //try locking the

Accessible contrast ratio vs. corporate identity guidelines

给你一囗甜甜゛ 提交于 2019-12-24 04:12:33
问题 Following up on a question asked here regarding contrast ratio requirements for WCAG AA, I'm trying to figure out the best solution for a conflict between WCAG guidelines and the corporate identity guidelines of the product I'm designing for. Throughout the product's UI, the brand's primary color is mostly applied for buttons. The combination of light text with the brand's primary color results with insufficient contrast ratio. For achieving sufficient contrast, I tried darkening the button

XNA 4.0 app closes suddenly when it hits a method without throwing any exceptions

亡梦爱人 提交于 2019-12-24 04:09:08
问题 As the title says, I have an XNA app that closes suddenly when it hits an app, but doesn't show any errors so I don't have a clue how to even begin to debug it. The code is very simple - I'm just playing with XNA and trying to render a simple triangle - so I can't imagine why it's stopping. The code that's running is VertexPositionColor[] vertices; public Terrain() { vertices = new VertexPositionColor[3]; vertices[0].Position = new Vector3(-0.5f, -0.5f, 0f); vertices[0].Color = Color.Red;

Detect passing of rectangle over yellow pixel

会有一股神秘感。 提交于 2019-12-24 03:54:07
问题 I have a query regarding the best approach to detect when a moving and potentially rotated rectangle passes over a yellow pixel of a Panel's background image. I have a method which accepts an Image and a Point, and returns true if that point is that of a yellow pixel. I require this colour detection for the function of my game, which resets the car (player) if it drives over the yellow borders of the track. This method is shown below: private Boolean isYellow(Image image, Point point) {