graphics

How can I make a program overlay text on a postscript file?

I have some graphs in postscript format, generated by gnuplot. I need to place some identifying information on the graph. How can I script some instructions to do that? I want to write a number at the top right corner of the graph (a .ps file). ...

Load a .obj file with Java3D and use it in JOGL?

I'm using Java3D and JOGL, but I'm having a hard time figuring out how to do this by looking at the javadocs. I want to load a .obj file (other formats would be nice, too) and render it using JOGL. Here's a loader class. It returns a Scene from a filename. How can I use this Scene in JOGL? Thanks. I'm new to JOGL and Java3D. ...

Android 2D Graphics - Dragging an Image onto Another Image

Hi, This is just a "where do I start" question, really. I'm working on an app where you dress up a 2D ragdoll from a selection of body parts. The aim is that the user will have a sillouhette figure on one side, and a selection of arms, legs, heads and bodies that they can sort through on the right. They can drag an image from the rig...

Problem occur in case structure

I am doing my project to implement a typing tutor application in turbo C compiler (this is the limit), this function is actually a look up table for x,y and key character but it is returning a garbage value at first value of that I passed in argument. From second onwards it starts doing right. Note that that x,y are pointers to return tw...

How to adapt DirectX-style world/view/projection matrices to OpenGL?

I have an application which uses DirectX, and hence a left-handed world-coordinate systen, a view which looks down positive z and a projection which projects into the unit cube but with z from 0..1. I'm porting this application to OpenGL, and OpenGL has a different coordinate system etc. In particular, it's right-handed, the view looks ...

Creating a Tree from a List of Rectangles

This may be a silly question, but nothing comes to mind straight away. Given a list R of 2D rectangles (x, y, w, h) arranged so that any given rectangle is either fully inside or fully outside any other, what's the most efficient way to determine the immediately enclosing rectangle p of each rectangle in R? Currently I sort R by y then x...

OpenGL: Model not displaying correctly. (Need to fix draw distance?)

I'm new to OpenGL. I'm playing around with JOGL. I have a .obj model that I'm drawing as polygons. It looks ok, except that most of it gets clipped. So I think that I need to increase the draw distance. I'm not really sure how to do it. Here is my render code: private void render(GLAutoDrawable drawable) { GL2 gl = drawable.ge...

SDL: FPS problems with simple bitmap

I am currently working on a game in SDL which has destructible terrain. At the moment the terrain is one large (5000*500, for testing) bitmap which is randomly generated. Each frame the main surface is cleared and the terrain bitmap is blitted into it. The current resolution is 1200 * 700, so when I was testing 1200 * 500 pixels were vi...

How to create a screen image from TColors and intensities (in Delphi)

I have a (spectrographic profile) data set of Wavelength (x-axis) and Intensity (y-axis, in arbitrary units that can have different ranges...) I want to convert this numeric data to a graphical view as shown at the bottom of the image below. But, I've never done anything in Delphi (2010) with Canvas's, TImages, bitmaps, or whatever way...

How to rotate a list of strings along an axis?

Hi, I have a list of strings which I paint on an axis. I want to rotate the strings (again, they should stay on the same horizontal axis when rotated). I am trying to use the following code: namespace DrawString { struct StringData { public string StringName; public int X; public int Y; } public...

R: how to change lattice (levelplot) color theme?

The default theme on my installation is something which maps the values to pink and cyan. How to change it for example to a gray scale theme? ...

What libraries are needed for graphics like vim or nano?

What library is used to make a static terminal window like vim, nano, irssi or aptitude as opposed to a scrolling terminal? I'm using C, but I'd be interested in libraries for other languages (for example, a C++ specific library). ...

How to draw a single line using MouseMove Event

Hi guys, I'm trying to draw a single line using OnMouseMove() event. My Problem is that everytime I move the mouse It leaves a trail. I tried to use the refresh method, but when I stop moving the mouse the line is gone. I don't want the line to be drawn OnPaint();, Just want to draw it OnMouseMove(). EDIT: I'm using a transparent pan...

Pixel dilemma: Choosing the right graphics API

I want to make a sidescrolling 2D game with destructible terrain. My approach is having the terrain as a BMP and having access to each pixel. However I have a problem with choosing the right graphics API for my game. I have already considered several options: SDL I started writing the game in SDL, I had the terrain as surface which...

How to draw graphics outside of the paint() function in a JFrame

I would like to be able to paint Images onto a JFrame, but whenever I want (not in the JFrame.paint method. For the project I am working on, I have a class Bullseye extends BufferedImage, and am trying to put it onto a JFrame: class DrawingFrame extends JFrame { public void drawImage(Image img, int x, int y) { getGraphics()...

What language should I choose to create a face?

I wanna build faces with different characsterics? The user gives specs about the face( color, shape) and the program should . I dont want to create an avatar or something like that using OpenGL. I want to create something easy preferably using ActionScript but I wanted to ask you guys what my options are? ...

Most Efficient Way to Create Thumbnails?

I have a huge volume of thumbnailing to do. Currently, I am using ImageMagick, but it's proving too inefficient (it's too slow, uses too much CPU/memory, etc.). I have started to evaluate GraphicsMagick, which I expected to get "wow" results from. I didn't get them. Can someone take a quick look at my benchmark script (does simple speed...

Media and graphics website

Is there a site like stackoverflow.com for graphics and media related queries ? A website covering FinalCut Pro or aftereffects ? Thanks ...

Programatically fill a nxn matrix with a gaussian filter in C++

I need to fill an nXn matrix with a Gaussian filter programatically. I've been trying to work this out for a graphics project, but i'm a little stuck. To clarify, an example 3x3 Gaussian filter matrix would be: [1, 2, 1] [2, 4, 2] / 16.0 [1, 2, 1] ...

How should I calculate the vertices on n intersecting planes

basically I am trying to model some map brushes that have the following format: Each brush defines a solid region. Brushes define this region as the intersection of four or more planes. Each plane is defined by three noncolinear points. These points must go in a clockwise orientation: 1--2-----------------> | 3 | | | | | , Each brus...