Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 4 months ago. Improve this question
Tag: geometry
Java awt draw elements around a circle
I’m currently writing a little game and I came over a problem. I need to draw 64 small circles at the border of a big circle. So I want something like this: I’ve already tried many things, but they didn’t worked. How can this be done in java, using the java.awt.Component#paint() method and the java.awt.Graphics class? Thanks. Answer So, your
JavaFX how to trigger events on Geometries?
I’m writting an JavaFX application, where i use UTM32 coordinates for my geometries, i have a dynamic stroke width dependent on my zoom level. The issue is that i can’t trigger events when my stroke width is decreased at a certain factor. If you use Intellij you can start a new fx-project and copy following code to reproduce this behaviour:
How to calculate which sector of a circle a given point is with custom sectors?
So I’m making a TD game where I can place a gatling gun, and depending on which sector of a surrounding circle the mouse is in, the sprite and bullet path will change. My difficulty is with creating an algorithm which will tell me which sector my mouse is in. My circle has 16 sectors, and a radius of 300.
How to create a rectangle for azimuth direction for n kilimeter
Suppose I have three four columns like item,item_latitude,item_longitude and azimuth. I am trying to create a rectangle for each lat and long in the azimuth direction for +/-35 degree and 2 Kilometer. Example . There is a azimuth of site x is 45 degree so +35 and -35 degree to 45 degree would be 15 degree and 80 degree and
Rendering 3D objects on 2D Canvas using Java AWT
I’m trying to port this JS code on Java because I got bored with programming a prototype of my 2D Java Game and I wanted to make my game into 3D, then I got this weird rendering bug, I think my math or logic was off… Sample data: Legend: Cube: the actual cube, has a transform of x, y, z
Get 3D coordinates of vertices of rotated and scaled cuboid with scale, center position and rotation on all axis
I have been wrecking my brain trying to figure out this problem I have. I have a cuboid, its rotation on all 3 axis in relation to the world from its center (it’s on 3D space), the cuboid’s center’s position and the scale of the cube in all axis (width, height and depth). I need to find the coordinates of
How to merge multiple rectangles into one polygon
I am struggling with this part of my task at work. I’ve deliberately not detailed the context of the work task to try and keep the focus on the problem. I have to merge rectangles into a single polygon as shown in the attached image, but I need the list of points so that I can write these out into
How to create a polygon in JTS when we have list of coordinate?
We can create a LineString using coordinates list like this: How can we create a polygon using coordinates list? Thanks in advance. Answer Use these line of codes: I hope it will help 🙂
Obtain ordered vertices of GeneralPath
How can I obtain the vertices of a GeneralPath object? It seems like this should be possible, since the path is constructed from points (lineTo, curveTo, etc). I’m trying to create a double[][] of point data (an array of x/y coordinates). Answer You can get the points back from the PathIterator. I’m not sure what your constraints are, but if