graphics

Sources for visual explanations?

Does anyone has sources for visual explanations of algorithms (or maths) that is even more expressive, more intuitive, maybe aesthetically appealing ? Or, animations of algorithms? ...

How to correctly draw a listbox and image in .net?

protected override void OnPaint(PaintEventArgs e) { e.Graphics.DrawImage(render, 400, 400); } This is the OnPaint of the Form1 class. The form has a listbox. The problem is with the render only showing partially when doing a resize on the form. Is the listbox somehow clipping it out? The listbox and the bitmap don't overlap. I've ...

Python - Best library for drawing

So I'm looking for a pretty basic library in python where i can create a window, and then draw lines and basic shapes too it. Nothing too complex, just nice and simple. I figure theres lots of libraries out there that can do this, but I don't know any of them. Can anyone give me some recommendations? Thanks EDIT: Note that there are se...

Spline, B-Spline and NURBS C++ library

Does anyone know of a library or set of classes for splines - specifically b-splines and NURBS (optional). A fast, efficient b-spline library would be so useful for me at the moment. ...

How do you copy from a rectangular source region to a non-rectangular/non-paralellogram destination region in .NET?

I know how to use the DrawImage() method of the Graphics object to copy from a rectangular source region to a rectangular destination region, and how to copy to a paralellogram region defined by a three-element Point[] array. Is there any way in .NET to copy from a rectangular source region to a 4-sided non-rectangular destination regio...

Transform a Direct3D Mesh

I tried to write a TransformMesh function. The function accepts a Mesh object and a Matrix object. The idea is to transform the mesh using the matrix. To do this, I locked the vertex buffer, and called Vector3::TransformCoordinate on each vertex. It did not produce expected results. The resulting mesh was unrecognizable. What am I doing...

Need a client-side interactive 2D world map: best map package? Or best C++ graphics/canvas library to make one?

I need a 2d political map of the world on which I will draw icons, text, and lines that move around. Users will interact with the map, placing and moving the icons, and they will zoom in and out of the map. The Google Maps interface isn't very far from what I need, but this is NOT web related; it's a Windows MFC application and I want ...

Learning SVG ?

Does anyone here know SVG ? If so how did you learn it. Any books/ tutorial pointer will be beneficial ? Also I am a programmer not a designer so I want to pick up some skills there too. ...

Image resizing in .Net with Antialiasing

I've got some C# code that resizes images that I think is pretty typical: Bitmap bmp = new Bitmap(image, new Size(width, height)); Graphics graphics = Graphics.FromImage(bmp); graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.SmoothingMode = Smoothin...

Basic art for the programmer?

This perhaps isn't really a programming question, but it's something I'm sure lots of programmers other than me have faced! I've almost finished an iphone application I've been working on, the only thing I'm missing is a spot of art - a title screen, small and large icons, that kind of thing. I have no artistic talent, but I've been fin...

How do you calculate the angle between two normals in glsl?

How do you calculate the angle between two normals in glsl? I am trying to add the fresnel effect to the outer edges of an object (combining that effect with phong shading), and I think that the angle is the only thing I am missing. Fragment Shader: varying vec3 N; varying vec3 v; void main(void) { v = vec3(gl_ModelViewMatrix * gl_V...

Generate colors between red and green for a power meter?

I'm writing a java game and I want to implement a power meter for how hard you are going to shoot something. I need to write a function that takes a int between 0 - 100, and based on how high that number is, it will return a color between Green (0 on the power scale) and Red (100 on the power scale). Similar to how volume controls wo...

JSP: Creating Graph

I need to create some graphical representations of the usage of electricity by month. How do I go with it? What would be the simplest way? Languages: Java, JSP Thank you very much. ...

How to set line spacing Graphics.DrawString

I arrive to output a string on multiple lines inside a retangle but haven't find a way to reduce or enlarge the line spacing. How to do that? ...

What can Pygame do in terms of graphics that wxPython can't ?

Hello, I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a Tetris clone in it, and it was pretty smooth. I wonder, what does Pygame offer in terms of graphics (leaving sound a...

Ball to Ball Collision - Detection and Handling

With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator. You click and drag the mouse to launch a ball. It will bounce around and eventually stop on the "floor". My next big feature I want to add in is ball to ball collision. The ball's movement is broken up into a x and y speed vector. ...

Drawing a point on the screen

I need to read the color of and draw to a calculated point on the screen What is the VB.NET equivalent of the old Peek and Poke, or PointSet and PointGet, commands in older versions of VB. Or in the alternative, is there a way to use a label as a Cursor object, so that it does not erase my picturebox contents as I move it around. I ca...

What is the best 2D graphics library for Windows Mobile?

The title speaks for itself... I've tried to find another question like it but must have missed it if it exists. I'm looking for anything, from a core library replacing GAPI to a .net wrapper... It's for building a nice UI so no 3D needed... ...

Calculating a LookAt matrix

I'm in the midst of writing a 3d engine and I've come across the LookAt algorithm described in the DirectX documentation: zaxis = normal(At - Eye) xaxis = normal(cross(Up, zaxis)) yaxis = cross(zaxis, xaxis) xaxis.x yaxis.x zaxis.x 0 xaxis.y yaxis.y zaxis.y 0 xaxis.z ...

set background color for php gdlib imagerotate and imagecopy

I'm using PHP 5 GD Lib to do some graphic manipulations, and I can't find a way to get around the black background that shows up when you rotate an image or copy an image to another (larger) image. Assuming that I am working with a jpeg file, which of course is not transparent, how can I rotate the image using gd lib and end up with a ...