graphics

32-bit PNG loading in .NET

Howdy, I haven't written any code yet, but I've encountered a similar problem before. Hopefully things have changed since the last time I visited it. I'm trying to do my own image conversion for games into a special OpenGL image format. In order to perform the conversion correctly, I need all pixel data and more importantly, i need al...

Textured spheres without strong distortion

I've seen well-textured balls, planets, and other spherical objects in couple of games, last time in UFO: aftermath. If you just splatter a texture into latitude/longditude as u and w -coordinates you'll get lots of ugly texture distortion to poles. I can think myself an one way to implement a spherical map with minimum distortion. By m...

Ajax Loading Icons - Where to Get?

Anyone know where I can get this icon in 32x32? And more generally what's a good source for finding Ajax loading icons? This one only offers 16x16. ...

Visual C++: Avoiding overlapping of paint events, arching lines through click and drag?

I am currently a student and trying to design a Visual C++ application to allow me to visually insert an oriented graph in order to create a text file with the graph's matrix. At this point I have created an onClick event to create nodes and have used the form's Paint event to draw the nodes. I have also inserted the conditions to avoid...

Point in Polygon aka hit test

What's your best, most elegant 2D "point inside polygon" or Polygon.contains(p:Point) algorithm? Edit: There may be different answers for floats vs integers. Primary goal is speed. ...

Are there any good Javascript graphics libraries?

After staring at this 3D cube and these triangles for a while I started wondering if there's any good reliable Javascript graphics library with basic 3D support. Any suggestion? ...

Set BufferedImage alpha mask in Java

I have two BufferedImages I loaded in from pngs. The first contains an image, the second an alpha mask for the image. I want to create a combined image from the two, by applying the alpha mask. My google-fu fails me. I know how to load/save the images, I just need the bit where I go from two BufferedImages to one BufferedImage with the...

What graphics card benchmark software do you recommend?

The graphics rendering on my development machine "feels" slow so I've just bought a graphics card to replace the on board graphics card. Before I install it I want to run some software that will measure the performance of my current card so that I can compare the before and after. Can you recommend something that will give me an object...

What is the best way to read, represent and render map data?

I am interested in writing a simplistic navigation application as a pet project. After searching around for free map-data I have settled on the US Census Bureau TIGER 2007 Line/Shapefile map data. The data is split up into zip files for individual counties and I've downloaded a single counties map-data for my area. What would be the b...

Resources for image distortion algorithms

Where can I find algorithms for image distortions? There are so much info of Blur and other classic algorithms but so little of more complex ones. In particular, I am interested in swirl effect image distortion algorithm. ...

How do I create blurred text in an iPhone view?

I am building up a view with various text and image elements. I want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow. How do I apply Gaussian blurred text onto a UIImage or layer? ...

RGB for color composition rather than primary hues

Why do computers use RGB (red, green, and blue) values for color composition rather than the primary hues, red, yellow, and blue? ...

How to view output .mp files from Functional MetaPost

I'm interested in using Functional MetaPost on Mac OS X: http://cryp.to/funcmp/ I'm looking for a tutorial like: http://haskell.org/haskellwiki/Haskell_in_5_steps but for a trivial FuncMP example, i.e. using GHC, I can compile something simple such as: import FMP myPicture = text "blah" main = generate "foo" 1 myPicture but I ...

Drawing an iso line of a 2D implicit scalar field

I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation. I would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0' iso-line can have multiple continuous instances and it is n...

Boundary for comment box

In my java application, I need to create a comment box for the users to add comments. Moreover, I need to provide the user with the provision for resizing and dragging the comment box. For this, I need to show a boundary around the comment box as in the case of comment box in Microsoft Excel which I have shown below: I dont need the c...

Learning about low-level graphics programming

I'm interesting in learning about the different layers of abstraction available for making graphical applications. I see a lot of terms thrown around: At the highest level of abstraction, I hear about things like C#, .NET, pyglet and pygame. Further down, I hear about DirectX and OpenGL. Then there's DirectDraw, SDL, the Win32 API, a...

Modelling an I-Section in a 3D Graphics Library

I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene. I could do this two ways: Using method A, I have fewer surfaces. However, with backface culling turned on, the surfaces will be visible from only one side. If backface culling i...

How to output a String on multiple lines using Graphics

My Program overrides public void paint(Graphics g, int x, int y); in order to draw some stings using g.drawString(someString, x+10, y+30); Now someString can be quite long and thus, it may not fit on one line. What is the best way to write the text on multiple line. For instance, in a rectangle (x1, y1, x2, y2)? ...

Sort Four Points in Clockwise Order

Four 2D points in an array. I need to sort them in clockwise order. I think it can be done with just one swap operation but I have not been able to put this down formally. Edit: The four points are a convex polygon in my case. Edit: The four points are the vertices of a convex polygon. They need not be in order. ...

Can we output a picture in c?

Hi can we output a .jpg image or .gif image in c? I mean can we print a picture as output with the help of a c program?Aslo can we write a script in C language for html pages as can be written in javascript? Can the browsers operate on it?if not possible is there any plugin for any of the browsers? any example code or links please? ...