Java and OpenGL Hiding cube faces not seen - java

I have made a OpenGL 3D Render engine in Java that uses vbo's and such for optimization. Now I'm trying to take it further by hiding faces not seen by the user. I'm confused though, I have so far tried doing things like scan to see if blocks were adjacent. Then I decided whether to render or not. This is not working at all, the blocks don't even render now. Whats an efficient way of doing this, or does anyone know a good article to read up on?

Related

Java 3D Object Rendering with Yaw/Pitch/Roll

Im looking for a way of displaying a 3D Rectangle, which could be moved by the values a gyrosensor delivers from my arduino.
I just don't know where to start with the Implementation of the 3D Space, the communication works fine.
I did not find any useful information online, however, I just need a Window (Don't know, is JFrame enough for this) with a model that I can set x/y/z and yaw/pitch/roll etc.
Are there libraries or code-examples?
I did see one integration with JavaFX which I have never used yet, or the implementations were in other languages.
Unity worked out for this, even though i was getting buggy behaviour.
Therefore i tried out Processing, which turned out to work fine. There are some snippets online where you can pass in the values of your arduino and it just works out.
I cannot provide more details since the project was abandoned.

The use of image processing to extract data from a diagram

I have a data flow diagram (a diagram that looks like a flow chart). It has a set of specific geometrical components like rectangles, circles, ellipses and arrows.
What I'm trying to achieve is to detect these shapes and be able to know which component is connected to which component (through the lines) and finally read the text inside each one to extract data from the diagram and do further processing. It is also notable to mention that the diagram will not be drawn by hand but computer generated so we don't have to worry about angles and ratios being inaccurate.
I'm currently working in Java and I was wondering if this is going to be possible since Java is not the best language when it comes to image processing (correct me if I'm wrong). And if it's possible I'd you guys to point out where I should start looking.
I think Java is fine, and it has many libraries to process images. ImageJ is just one example. Personally, I like to use Python, so I write scripts in this language using Java API of the DMelt platform. Look at the documentation of this projecst, wiki. Here is a link to a few examples.
Doing this in Java wasn't a great idea because mainly the lack of online resources. After a good amount of research, I found that the best and the easiest approach was the use of C# and Emgu CV which is a cross platform .Net wrapper to the OpenCV image processing library.
This example helped me to get started with detecting basic geometrical shapes like Lines, Rectangles and Triangles.

Is capturing screen image and displaying it on an application every second effective?

I'm new to programming but I really wish to improve, right now learning Java. Basically there is this game, online strategy it's pretty basic with most of the images are static and very few of them change. I wish to change how I view the game from my end and add some functionality to it as well.
For example the website displays an orange rectangle, I wish to display a red rectangle by drawing over it. Or drawing a button when, if clicked, re-directs me to another part of the game. Originally I am using Selenium Chrome WebDriver to navigate the website but it seems you can't paint or display your own images over it. So I was wondering if I should use Selenium headless in the background performing tasks while I just make a Java Application. Make the WebDriver capture the image every second and display it on the Java Application every second, and than edit that image to my liking? Would this be effective way to do it or is there better options?
It is not clear what you are actually trying to achieve here. And whether your approach is likely to be "effective" depends what you are trying to achieve!
However, I can see some issues:
I don't know if it is technically possible to get the Selenium WebDriver to do that ...
Capturing images at a high rate could be problematic from a performance perspective.
Once you have captured the images:
Modifying the images by hand would be tedious and labour intensive. (And probably not what you want to do.)
Modifying static images programatically would be possible, but fiddly to implement and incredibly fragile. The slightest change to the game's screen rendering could result in your "tweaks" writing to the wrong place on the image.
Making changes to the dynamic part of images would be next to impossible ... except in the destructive sense.
You can't affect game play by this approach. Nothing you do to the images will impact on the browser and hence on the server. You can't add functionality this way.
In short, this is a poor idea, and unlikely to achieve anything worthwhile.
Can I think of any good options? No I can't.
The best I can think of would be to:
reverse engineer the HTML / Javascript uploaded to your browser,
figure out what you want to change in that content, and
place an HTTP proxy between your web browser and the server that injects the relevant changes into the content.
However:
It will be a lot of tricky and tedious work to implement.
It will be fragile; i.e. changes to the game / game server are liable to break your "hacks".
It could be a violation of the game owner's copyright and/or the license that grants you the right to use the game. This could result in your game accounts being cancelled, along with the accounts of anyone else who uses your "hacks".
My advice? Just play the game!

Java robot and image comparison

I'm toying with an idea for creating a Java application to automate a process that I have to do regularly and before I start any coding I thought I would seek advice as to the best way to approach it.
Basically, the application I use has a large number of images present on the screen at any one time, and what I would like to know is if there is a way to have Java identify if any of these two images are the same. If they are, I would like to automate mouse movement and button clicks.
After a bit of reading, I'm thinking that the PixelGrabber and Robot classes might be the right way to start, but like I said, I'm looking for any information on this that can be offered.
What are your suggestions?
I believe the Robot class and a Pixel Grabber would be sufficient. If you are inclined to program the solution yourself, maybe for educational purpose, by all means please do. If you, however, don't want to reinvent the wheel, you may take a look at this project:
http://sikuli.org/
I, for example, use it to do stuff that would be hard to achieve with Selenium alone. If you still can't achieve your goal after some scripting, Sikuli provides a nice API which you can use from inside your java program.
The Robot class would be sufficient to take images and being able to inspect pixels. But it seems to make more sense, to recreate your desktop with images inside of a java application (a very simple gallery application). Then operations are simplier. An other way of realizing operations I do not see.

What are some techniques to create scrollable areas?

I'm getting started with OpenGL ES on Android and I'd looking to learn some techniques to have a game map larger than the visible area.
I'm assuming I've somehow got to ensure that the system isn't rendering the entire scene, including what's outside of the visible area. I'm just not sure how I'd go about designing this!
This is for simple 2D top-down tile based rendering. No real 3D except what's inherent in OpenGL ES itself.
Would anyone be able to get me started on the right path? Are there options that might scale nicely when I decide to start tilting my perspective and doing 3D?
There are many, MANY techniques for accomplishing this goal, but the base idea of what you are looking for is called Frustum Culling, that is not drawing anything the user isn't going to see anyway. Here and here are a couple of tutorials on how this works.

Categories

Resources