I'm writing a Java game engine (http://victoryengine.org) and I've been experimenting with generating "3d" images with depth that you can see with those red/blue glasses. I'm using Java2D for graphics.
I've created something that works, but is very slow (by manually copying pixel values and stuff like that).
What I need to is take two ...
Hi, I'm involved in a project in which we're doing a visual editor (written in Java). Now, I'm trying to make curves that join two different objects that I'm painting in a class that extends JPanel (this class is what I'm using to paint, inside a JFrame, overriding the method paintComponent). I'm in troubles because I'm using the class Q...
Hi, I'm trying to create a curve that passes through three given points in Java (I'm drawing the curves through a class that extends JPanel). How can I make it?
Thanks!
...
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.
...
If I am drawing images using Groovy's GraphicsBuilder, how do I determine the size of the text I am drawing?
I could use Java's FontMetrics class but it requires a Graphics object and I'm not sure how to obtain one when using GraphicsBuilder.
...
I need to draw a line using java.awt.Graphis, but only the portion of the line that lies outside a rectangle should be rendered.
Is it possible to use the Graphics clipping support?
Or do I need to calculate the intersection and clip the line myself?
...
Hi gentlemens (and ladys)
I am currently creating an Eclipse View that has to contribute an Eclipse RCP app' and which must be nice (and only this one, I don't need an eclipse skin or something like that because my eclipse RCP app must look the same as a regular eclipse app), I must integrate translucent png, mouving gradients and contr...
I recently purchased the book Filthy Rich Clients and i found it really useful and fun. Building on one example from the book i tried implementing a custom ScrollPane that displays a "shadow" on the bottom of its view over the component to be displayed. I ended up with the code below. It works but not perfectly. Specifically when i scrol...
Hi all.
I have recently been developing a sim game in java, as many of my questions show, and it's come a long way! Graphically, it is somewhat lacking, and at current I'm using shapes for items, people, rooms ect.
I was looking at other similar projects, and noticed that one was using OpenGL. I have been reading CokeAndCode "space inva...
Given a rectangular input image I'd like to create an output image of size 40x40 pixels using a maximum of 10 colors. Hence, the two operatons needed are re-scaling and color reduction.
The following ImageMagick command does the trick:
convert input.png -scale 40x40 -colors 10 output.png
How would you achieve the corresponding result...
Is there a succinct example of how to upload an image, resize it, store it in a database and then serve the image up using Lift?
I'm sure I could piece it together from the file upload, Java 2D API, Lift Mapper and Response APIs. But is there any example code I can follow to do it the 'correct' or recommended way?
...
I have problem drawing the triangle polygons based on the coordinates which are stored in linked list. When I checked the linked list elements using System.out.println in paint component method
Public void paintComponent (Graphics g) {
...
for (Polygon p : triangles) {
g2.drawPolygon(triangle);
... // print the elements...
Can anyone recommend a good 2D animation package for Scala? I prefer something which already have some basic events handling, more like JavaFX than like processing.org.
...
I'm looking to call repaint() in my Java2D simulator at regular intervals.
What would be the best way to do this? Should I start another thread and have a loop that keeps track of currentTimeMillis()? Or is there a better way?
...
I'm drawing a bunch of primitives using Java2D on the screen and I'm getting a lot of tearing/flicker.
How can I enable/use double-buffering so it draws it off screen then shows the whole thing?
...
How can I draw a portion of my Java2D simulation that doesn't change to an image/buffer so I don't have to redraw it's primitives each time?
I have a portion of my Java2D simulation that requires me to draw thousands of small lines. However, this portion of the app doesn't change once drawn so it doesn't make sense to re-draw thousands...
Hi I'm starting to work on this project where I need to have a picture (map of the US) and then I need to circles of different sizes on the map at different locations. Something like this: http://www.npr.org/templates/story/story.php?storyId=110997398
What's the best way to go about doing it? I've never dealt with Java 2-d but I'm guess...
I have a JPanel for which I set some image as the background. I need to draw a bunch of circles on top of the image. Now the circles will be positioned based on some coordinate x,y, and the size will be based on some integer size. This is what I have as my class.
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Imag...
If I draw some circles using Java2D. Is there a way display some text when I hover over any of the circles? i.e. I want to display the ID of that circle and some other stuff.
...
When using VolatileImage to do accerlerated Java2D operations, how do you properly use the methods validate(GraphicsConfiguration) and contentsLost() to ensure that nothing goes wrong. When do you call which method?
...