graphics

Quaternion math for rotation?

I'm drawing a flat disk using gluDisk() in my scene. gluDisk() draws the disk facing the positive Z axis but I want it to be facing some arbitrary normal I have. Clearly I need to use glRotate() to get the disk facing properly but what should be the rotation? I remember this can be calculated using Quaternions but I can't seem to remembe...

Flex: Points to pixels and back again

So I have extended the PlotChart that comes with Flex to have the ability to draw trend-lines. To do this, I have to get pixel positions. How can I convert (100px,100px) in pixels to a point on the graph, such as (0.7,1.0)? ...

c#: Rotating Text within a custom control

I am attempting to rotate some text within a label. I have a cusom label which allows me to have control over the text rendering process. protected override void OnPaint ( PaintEventArgs pe ) { Graphics g = pe.Graphics; g.RotateTransform( angle ); g.drawString( text ); g.ResetTransform(); } The problem I am having i...

Can Google O3D be used as a Rich Internet Application framework?

Although it's pegged as a 3D graphics framework for the browser, could Google O3D be used as an RIA framework similar to GWT, Flex or Rails? ...

Improving raytracer performance

I'm writing a comparatively straightforward raytracer/path tracer in D (http://dsource.org/projects/stacy), but even with full optimization it still needs several thousand processor cycles per ray. Is there anything else I can do to speed it up? More generally, do you know of good optimizations / faster approaches for ray tracing? Edit:...

How can I set RenderingHints globally?

For a Java application, can I set the RenderingHints on a global basis? Currently, I've defined these in the paintComponent method as shown below. I would prefer, however, to set them once when the application starts and have them persist throughout the session. @Override protected void paintComponent(Graphics g) { super.paintComponent(...

Organizing Master Graphics Files For A Web Application (Photoshop / Gimp)

Some of us programmers have to deal with graphic files every once and awhile... Making quick fixes to existing graphics Throwing together a quick sprite as a prototype Create an icon because the designer is too busy I don't think anybody should ever be editing web graphics (jpg / gif / png) directly. They should edit the master file...

Are there any rendering alternatives to rasterisation or ray tracing?

Rasterisation (triangles) and ray tracing are the only methods I've ever come across to render a 3D scene. Are there any others? Also, I'd love to know of any other really "out there" ways of doing 3D, such as not using polygons. ...

Image browse by color/color range: need examples and/or code

At some long-ago Flash conferences I recall seeing a demo of a Flash app that had a color picker. Based on the user's color choice the app would show the user a set of images within the approximate range of that color: a bunch of mostly red images, a bunch of mostly blue images, etc. I'm looking for two things: 1) A link to a demo of ...

Best thing for 3D and raytracing

I want to play around with some graphics stuff. Simple animations and things. I want to fool around with raytracing too. I need help finding a library that will help me do these things. I have a few requirements: Must be able to do raytracing Must be for a high level language (python, .NET, etc.). Please no C/C++ Must have good documen...

Draw array of bits(rgb) in windows

I have an array of raw rgb data. I would like to know how can I draw this pixels on the screen in Windows OS? Now I use API function DrawDIBits, but I must turn up my image data. ...

Flash AS3 - how to set Imported textfield movieclip as unselectable

Hey there, I created a graphic in Flash CS4 that contains text. I embedded the appropriate characters then saved it as a MovieClip into my library. I then exported it to an SWC file. In my AS3 code (using Flex SDK/notepad), I then import the movieclip and assign it some mouse events so I can use it as a button. Unfortunately, all the ...

Best solution for simple game graphics in C#/.net

I'm making a turn-based top-down game in C#. The graphics requirements are pretty simple: it's entirely 2D, requires drawing some images taken from graphics files (perhaps rotating them first), line drawing to make a hex grid and the ability to place text at any position on the screen. I'm wondering what the best API is for doing these ...

What's a good, affordable "knob" library?

I'm currently thinking of a new pet project, an "editor" for MIDI-enabled synths. I've got the MIDI side covered, I suppose, but what I'm looking for right now is something that can pass for nice "dials" and "knobs" like you see in Ableton Live, Reason, Reaktor, and so forth. Putting my form full of trackbars, is sort of wasteful, y'kno...

iPhone OpenGL ES 2d background texture

Hi, i have a 1024 x 1024 image I use for a texture in my game for the background. Im wondering if their is a proper way to handle drawing a large background texture. How I am doing it currently: texCoord { 0,0,1,0,0,1,1,1 } vertice { 0,0,0,height,width,0,width,height } texCoordPointer(texCoord) vertexPointer(vertice) bind the texture...

Java Cross Hatching Texture

Any know how to recreate a cross hashing texture in Java? The C# code belows shows how to accomplish this for the .NET framework. The Java snippet is close, but I've been unable to correctly rotate the lines by 45 degrees. C# HatchBrush crossHatch = new HatchBrush(HatchStyle.Cross, somecolor, somecolor); Java BufferedImage b...

What's the best 3D graphics library for Java web apps?

I'm looking for a 3D graphics library for a Java web app. Could use some recommendations - only open source, though. Edit: I don't really care how the graphics are output - Javascript/applets/canvas/flash but I want to write the graphics logic in Java. ...

Transform pixel height of image to printing size used by graphics object

As part of a print procedure of my application I'm trying to print a list of images scaled down to a specified width and placed one below the other. The problem is I can not figure out how to transform the height in pixels of the images to the height in the units used by the graphics object during printing. How do I calculate the imageHe...

Clearing the graphics of a transparent panel C#

I have a WebBrowser control with a transparent panel over the top of it, what I am trying to do is draw a rectangle on the transparent panel around the element in the page that the mouse is hovering over. So far I have everything working except the panel is not being cleared before drawing the next rectangle so I end up with rectangles ...

Smooth ( animated ) GUI transitions

From time to time you can see smooth animated transition displayed for resizing, expanding and appearing graphical controls. Not just some tail-wagging file search dog, but animation of widget configuration changing it's state structurally and/or geometrically. I haven't used Windows Vista much, but sure know that on XP you can set this...