graphics

Intersection of a line - game development

I am creating a game where I want to determine the intersection of a single line. For example if I create a circle on the screen I want to determine when I have closed the circle and figure out the points that exist within the area. Edit: Ok to clarify I am attempting to create a lasso in a game and I am attempting to figure out how I c...

Drawing the slices of a 3D pie chart in the right order

I'm trying to fix up an old application: I have a function that takes a pair of angles and draws a 3d slice of an exploded pie chart. I also have functions that take a collection of numbers, generate the angles and call the slice drawing function repeatedly until the entire pie is drawn. Repeated calls to the slice drawing function draw...

What kind of language should I design for a particle engine scriptable engine?

I was wondering which kind of expressiveness fits a language used to generate particle effects.. Supposing to want an engine as flexible as possible what kind of 'features' should it have? (in addition to trivial ones like color, position, velocity, acceleration) ...

How to deal with animating in-between states when the model is discrete

The data model in my program has a number of discrete states, but I want to animate the transition between these states. While the animation is going on, what the user sees on the screen is disconnected from what the underlying data is like. Once the animation is complete, they match up again. For example, let's say we have a simple gam...

2D motion blur solutions

I'm thinking of chucking motion blur into my 2D program, but I doubt the results of my current algorithm. My approach looks like this at the moment: Draw to backbuffer. When time to update front buffer, blend the backbuffer onto the front buffer. Repeat What would cause the "motion blur" effect is obviously the blending, as objects...

Moving Objects in Center-of-Mass Viewport

I'm modeling a force-based physics simulation where several particles are interacting with each other. The particles can move in such a way that a static viewport can easily lose track of them (imagine the whole group of particles moving off the screen to the right and the viewport displaying a blank background). My current solution is...

Ruby Programmer collaboration with Graphics Designer: Best practices?

I've been programming for many years and have just recently got the RoR "itch". I'm thinking about how I could utilize a graphic designer and wondered how best to collaborate with them: 1) Do scaffolding and then show them where to place the graphics in the views (seems ugly) 2) Have them do screens and make them keep a certain dir st...

How to avoid tearing with pygame on Linux/X11

I've been playing with pygame (on Debian/Lenny). It seems to work nicely, except for annoying tearing of blits (fullscreen or windowed mode). I'm using the default SDL X11 driver. Googling suggests that it's a known issue with SDL that X11 provides no vsync facility (even with a display created with FULLSCREEN|DOUBLEBUF|HWSURFACE flags...

How do you resize a Bitmap under .NET CF 2.0

I have a Bitmap that I want to enlarge programatically to ~1.5x or 2x to its original size. Is there an easy way to do that under .NET CF 2.0? ...

Best way to programatically create image

Hi, I'm looking for a way to create a graphics file (I don't really mind the file type, as they are easily converted). The input would be the desired resolution, and a list of pixels and colors (x, y, RGB color). Is there a convenient python library for that? What are the pros\cons\pitfalls? Udi ...

Catmull-Rom splines - how do they work?

From this site which seems to have the most detailed information about catmull-rom splines: http://www.mvps.org/directx/articles/catmull/ it makes mention of needing four points to create the spline. However it does not mention how the points p0 and p3 affect the values between p1 and p2. Another question I have is how would you create ...

How to read and modify the colorspace of an image in c#

I'm loading a Bitmap from a jpg file. If the image is not 24bit RGB, I'd like to convert it. The conversion should be fairly fast. The images I'm loading are up to huge (9000*9000 pixel with a compressed size of 40-50MB). How can this be done? Btw: I don't want to use any external libraries if possible. But if you know of an open sourc...

Get the graphics card model?

hi all, I was wondering how I can get the graphics card model/brand from code particularly from DirectX 9.0c (from within C++ code). Thanks for any help! ...

Graphical web library which allows to click "arcs" on diagrams (see the screenshot)

I need a JavaScript library, or flash as well, which allows to connect events to "click" over "arcs" in graphics, see this picture: I've implemented my graphic through the JS-Graphs library but I can only intercept the "click" event on "nodes", not on "arcs". Can anybody help me?? Thanks. ...

How to draw a decent looking Circle in Java.

I have tried using the method drawOval with equal height and width but as the diameter increases the circle becomes worse looking. What can I do to have a decent looking circle no matter the size. How would I implement anti-aliasing in java or some other method. ...

Drawing several transformed images using Quartz on the iPhone

Hi all, I'm trying to figure out how best to accomplish drawing a scene in an iphone app. Here is the situation: I have a single view that I would like to draw to I would like to have a background image I would like to draw several different images on top of the background each which have separate transforms applied to them (rotation,...

Write text along a curve in Java.

I was wondering if it were possible to fit text along the curve of a circle. It would be great if there were a way to accomplish this in Java2D. ...

How do I destruct data associated with an object after the object no longer exists?

I'm creating a class (say, C) that associates data (say, D) with an object (say, O). When O is destructed, O will notify C that it soon will no longer exist :( ... Later, when C feels it is the right time, C will let go of what belonged to O, namely D. If D can be any type of object, what's the best way for C to be able to execute "dele...

Stretch Bitmap without anti-aliasing

I found this example and used it http://stackoverflow.com/questions/1082884/how-do-you-resize-a-bitmap-under-net-cf-2-0/1082890#1082890 However my image looks horrible because of anti aliasing. It no longer looks pixelated as it should. How do i disable anti aliasing? ...

java print api - printing JComponent at 300dpi

please tell me if I am doing something wrong. I want to print barcodes onto labels, so I need high quality printout for these barcodes so I am pushing printer to print in 300dpi. What I've done: made a big JFrame; width: 2490px, height: 3515px so it represents A4 paper in 1:1 measure (this is A4 paper resolution if print is to be 300...