graphics

Run OpenGL programs on older hardware through mesa [closed]

这一生的挚爱 提交于 2019-12-13 08:14:24
问题 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 6 years ago . I need to install OpenGL3.X on several computers whose graphics card might not support versions above 2.0 for teaching purposes. Apparently on windows, that doesn't work as there are no updates for the drivers. However i have heard about Mesa and how it provides a software implementation for most of the Opengl

Add ActionEvent in Swing [closed]

本小妞迷上赌 提交于 2019-12-13 07:50:20
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . class ImageComponent extends JComponent implements MouseListener, MouseMotionListener { private final BufferedImage img; private Point p1, p2; public ImageComponent(File file) throws IOException { img = ImageIO

Python, Pygame, Image manipulation: Restretch a loaded png, to be the texture for an isometric Tile

牧云@^-^@ 提交于 2019-12-13 07:48:48
问题 I'm a 17 year old programmer, trying to program an isometric game in python, with pygame. After finishing a tile engine, working with not good looking, gimp-drawn PNG's, I wondered, if it would be possible to render some Tiles by texture. I hope I provided all what's needed to understand, what's my issue and please excuse my not perfect English. Simply what I want to do, is to generate a 128 by 128 Pixel width Image of an Isometric Tile, using the following picture as texture for all three

Vertex Locations are off when using Mesa Core Profile

廉价感情. 提交于 2019-12-13 07:46:50
问题 I am using Mesa 10.1.3 to be able to use OpenGL 3.3 on my Linux computer. I request a core profile when I create the window since only the core profile has OpenGL 3.3. But when I tried to write a simple program to display a triangle on the screen, I got nothing. So I thought I screwed up somewhere in the code but I rechecked it and it was correct. To test this, I tried running the program in Windows and it was working as it should. So I experimented a little bit more with the code; I

jframe flash when updating graphics [closed]

删除回忆录丶 提交于 2019-12-13 07:18:57
问题 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 3 years ago . At below, its my code to make a renewable graphics shows life game itself. public paint(Graphics g) { g.setClip();//Set g.setColor(Color.BLACK); Processing..... while(true) { g.clearRect();//Clear g.drawLine(); //Draw; Calling SwingWorking to prepare next statement } } seems it's stupid to do like this way

Computer Graphics: Rotating a polygon

淺唱寂寞╮ 提交于 2019-12-13 07:18:35
问题 Purpose I'm implementing a polygon rotation with Java AWT. I'm already able to draw polygons on the screen, and I'd like to apply a rotation matrix manually upon my polygons coordinates (rotation is done around the lookAt point of the user). What I've already done In order to rotate the world, the user first clicks on the screen and then drags the mouse around to perform the rotation. Let's note the first click point as S, the following point from the drag event as L, and the center of the

Multiple independent layers in Graphics

本小妞迷上赌 提交于 2019-12-13 07:13:59
问题 Is it possible to have multiple independent drawing layers using Graphics ? I actually need two layers (like in Photoshop, Gimp, Paint.NET, ...) on which I can draw objects and I want all objects of the top layer appear above all objects of the bottom layer, independent of the order in which objects are drawn. It is not the case that I can first draw all objects of one layer and then draw all objects of the other. Example: draw red filled circle on bottom layer draw green rectangle on top

How to avoid curved corners in rectangular patch element in matlab figure?

末鹿安然 提交于 2019-12-13 07:07:03
问题 When I generate a set of rectangular patches in a matlab figure, some of the rectangle edges are rendered curved or clipped rather than sharp, which is unwanted. This depends on the scale, zooming into the image tends to eliminate the effect. I thought this might have to do with an aliasing/compression effect. Curiously, using rectangle the problem seems to go away. Here is an example of the problem at intermediate magnification (other problems such as dashed borders which shouldn't be there

Change color of graphic rectangle dynamically

无人久伴 提交于 2019-12-13 07:00:57
问题 I have write a c# class, which contains graphics inside. this is how I build the class and draw the rectangle. It works perfectly: public Graphics shape; public Rectangle rc; // constructor public CLASS_NAME(Graphics formGraphics) { this.shape = formGraphics; } public void draw(int x, int y, int w, int h) { SolidBrush myBrush = new SolidBrush(Color.Red); this.rc = new Rectangle(x, y, w, h); this.shape.FillRectangle(myBrush, rc); myBrush.Dispose(); } then I wanted to add a new method to the

Line detection in Java

回眸只為那壹抹淺笑 提交于 2019-12-13 06:59:22
问题 My main goal is to detect the little line over the left of the image: By detecting line I mean I want a line equation of this form: y = ax + b. In order to find the line, I tried using this Hough Transform java class, which doesn't return the equation I want but at least supposed to find the line, but what happens is that it does not detect the line I want (it actually locates only the horizontal line in the image, and even this is not perfect. The y cord is located perfectly but the x is