graphics

How can I successfully extend Graphics in Java

I'm trying to create a generic graphics export tool which works by implementing the Graphics interface and intercepts and interprets the calls to its various methods. However although I can do this successfully for a single component my Graphics class is being replaced when I use it on a component which contains other components. Stran...

Simple object-oriented 2D graphics framework for use in Visual C++?

We're building a method of connecting components visually via a GUI in a Visual C++ application (MFC). Simple things like clicking on boxes and drawing lines between those that are connected, and storing information on them. The problem is that we're making all this by ourselves from the ground up in GDI and it quickly becomes a heck of ...

How do you draw like a Crayon?

Crayon Physics Deluxe is a commercial game that came out recently. Watch the video on the main link to get an idea of what I'm talking about. It allows you to draw shapes and have them react with proper physics. The goal is to move a ball to a star across the screen using contraptions and shapes you build. While the game is basically...

Zooming to a point in c#

I am attempting to write a custom scrollable c# control that zooms to a particular point on an image. The problem that I am facing is that when double buffering is enabled, the image seems to jerk towards the top left corner and then zooms properly to the point where the mouse was clicked. This seems to only happen when I set the AutoScr...

Beginner's guide to 3D graphics programming

What are the best guides / tutorials / books / websites for someone with minimal experience (or none) in the world of 3D graphics programming? I realize that the fundamentals of 3D graphics and mathematics apply across platform specific 3D library implementations such as OpenGL, DirectX, WPF etc.. Therefore it would be useful if answer...

Creating a linear gradient in 2D array

I have a 2D bitmap-like array of let's say 500*500 values. I'm trying to create a linear gradient on the array, so the resulting bitmap would look something like this (in grayscale): The input would be the array to fill, two points (like the starting and ending point for the Gradient tool in Photoshop/GIMP) and the range of values whic...

How do I generate non overlapping circles in a fixed region?

What's the best way to generate a known number of non overlapping fixed radius circles in a limited space? ...

How to draw a Perspective-Correct Grid in 2D

I have an application that defines a real world rectangle on top of an image/photograph, of course in 2D it may not be a rectangle because you are looking at it from an angle. The problem is, say that the rectangle needs to have grid lines drawn on it, for example if it is 3x5 so I need to draw 2 lines from side 1 to side 3, and 4 lines...

WPF video tearing on Windows XP

I've created a WPF application using C# that renders about 50 3D elements and animates the camera in order to move around the scene. While it all works, I've noticed as the camera moves, ugly video tearing occurs. I'm well aware of the standard cause of tearing, ie the application is updating frames at a different rate from the monit...

Why does wgluseFontBitmaps consume too much memory on some computers?

I'm creating a game in OpenGL which loads the entire Arial Unicode MS font when it loads. The program uses on avg. 10 megs of memory on my computer (op sys is WinXP SP2) and runs without problems, but when I move the program to my laptop (with Vista) the wglUseFontBitmaps hangs and allocates memory fluently and never returns. This proble...

Non-Affine image transformations in .NET

Are there any classes, methods in the .NET library, or any algorithms in general, to perform non-affine transformations? (i.e. transformations that involve more than just rotation, scale, translation and shear) e.g.: Is there another term for non-affine transformations? ...

Anyone familiar with the ZedGraph charting library for .NET?

I am working on a project for my company and I need to integrate some graphs of different types and average complexity to C# in the process of studying stock markets. I found this free library on the net (ZedGraph). If you came accross it, do you recommend using it? And how well is it supported? ...

"Screen" effect in Java 2D graphics

This is a question that's been bugging me for some time now: In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque. I would dearly love to be able to replicate this composite using Java 2D graphic...

How can a convex polygon be broken down into right triangles aligned on the X- and Y- axes?

Given a convex polygon represented by a set of vertices (we can assume they're in counter-clockwise order), how can this polygon be broken down into a set of right triangles whose legs are aligned with the X- and Y-axes? Since I probably lack some math terminology, "legs" are what I'm calling those two lines that are not the hypotenuse ...

Use fov and center pan and tilt values to calculate boundary's pan and tilt?

I have the current fov and the center pan and tilt values. How would I calculate what the pan and tilt values are of the edges(i.e. min pan value and max tilt) with this information? ...

How do I draw text with GLUT / OpenGL in C++?

How do I draw a text string onto the screen using GLUT / OpenGL drawing functions? ...

different openGL functions on iPhone: OpenGL vs OpenGLES

There are number of functions that exist in OpenGL but not in OpenGLES 1.1 (for iPhone). Is there a list or resource that lists some alternative functions that can be used in OpenGLES 1.1? For example: gluOrtho2D glPolygonMode glVertex3f etc? Thanks ...

VGA standard for Graphics Controller

I'm attempting to create a generic graphics controller for VGA monitors with an Altera FPGA via a VGA connector, but I cannot find any good online resources explaining the standard specification which monitors use. I've found all the pin descriptions and some resources which describe how to create a specific graphics controller, such as ...

Estimate pixels of proportional font in SVG or Java

Is there an way to estimate the number of pixels used by a proportional font? I am writing software that creates an image in SVG and transform that to PNG in Java. In this image I am using a text with a proportional font (size 16). I can sometimes fit 26 characters in the picture and sometimes only 19. This is because 'WWW' takes much m...

Can a JPEG compressed image be rotated without a loss in quality?

JPEG is a lossy compression scheme, so decompression-manipulation-recompression normally reduces the image quality further for each step. Is it possible to rotate a JPEG image without incurring further loss? From what little I know of the JPEG algorithm, it naively seems possible to avoid further loss with a bit of effort. Which common i...