Hello there guys and gals
I'm just little bit confused about creating simple way finding using the java programming language?
Or is it possible in java? I want to create a simple way finding just like these
Do you have any suggestions for this particular matter?
You need to use a shortest-path algorithm and a matrix-builder from the way-points of your map. Java 3D has built-in primitive shapes such as cylinders, spheres and cubes. But you can make your own geometry from points, triangles and quads. See some of the java3D tagged questions in SO.
In java3D, mouse and keyboard interaction is very easy implemented.
Collision detection is also a good pro of java3D while not having a shadow lib being a con.
You can try 3D Wayfinder. They have a public API and fully featured 3d wayfinding. Its not in Java but uses HTML5, WebGL and JavaScript. Yiu have to upload just a floor plan model and are good to go.
Related
I will be working with an application that will use 3D graphics in Java and I am pretty sure we'll need an arc object in 3D. I've seen some proposed methods on how to do that, one of which entailed creating an Arc2D object and then rotating it in 3D. Not quite sure how to do that because I couldn't find how to rotate a plane in Java 3D, but I imagine I need to use the javax.media.j3d.J3DGraphics2D object.
Regardless, I am wondering if it is worth my time to create an Arc3D object. It will make everyone's life much easier, it makes more sense to simply have an arc in 3D than create an entire drawing plane and then rotating it, and overall it would be a contribution to Java programmers.
My questions are, from your experience, how long does it take to create a new class that works in an existing API? and where would I start? I tried looking at the Graphics, Graphics2D, and Arc2D documentations and couldn't find where the actual drawing takes place so I can see how to do the same in 3D.
Any help?
The 'AWT Shape Extruder' API supports extruding of an Arc2D object in Java 3D. Download is available here: http://www.interactivemesh.org/testspace/awtshapeextruder.html
I'm working on a 2D four-side scrolling game and I am currently implementing collisions. I was surprised to see that there is no pixel-perfect collision library implemented in the standard library, and so I wrote my own collision "engine" with geometrical forms to represent non-geometrical figures. For now, it works fine, but I really want to know if there's a way to just get it all over with, thanks to a well-built library. If anyone knows of one, please share it.
I recommend you to take a look to AndEngine. You can see one video here about 2d pixel perfect collision:
http://www.youtube.com/watch?v=abbXURuDaTo
I've been working on making a video game, and I've had alot of debate between a few languages, Java can be used well for 3D games but. Can Java make 2D bird's eye view games? I'm quiet new to programming so sorry if I seem somewhat ignorant. Thanks for your time!
that's not a question can Java make a 2d bird's eye game?. the main quesiton is does a 2d bird's game created with java meet your needs or not?. just by looking at cell phones you can easily spot many 2D games using bird's eye camera created with java. so it sure can!
Yes. (This simple answer is as exciting as the question.)
I used LWJGL to make a 2D "bird's eye" game in OpenGL. It just requires setting up the perspective correctly. Performance on a laptop (with a proper OpenGL 1.6+ dedicated video card ;-) was more than adequate for a large number of objects and particles.
However, LWJGL is a low-level OpenGL/basic-IO wrapper targeted for games and is the "hard way". There are other Java game libraries (some are just 2D like Slick) to make writing a game easier. According to list of game engines this also includes Jake2, Jogre, and Java Monkey Engine (3D, but see above).
If one felt like being .. silly .. the Java 2D API could be used directly (there are cases when it will try to use hardware acceleration but there are also gotchas). I do not do any JME programming, but I would suspect there are also frameworks for it.
And remember -- a "bird's eye view" is simply the chosen projection/rendering for a given model.
Happy coding.
I'm looking for a graphic library that allow me to plot a pixel point in a specific color with the purpose of draw a fractal (mandelbrot set). I've read the basic math behind fractal and I understand it, the algorithm is not difficult.
But I don't know what graphic library could I use, I don't need anything sofisticated and complex, just print a pixel set with colors. What do you suggest me? Cairo? OpenGl?.
Note: I only have experience with pygtk. I was reading the Java API and found the the fillRect method and BufferedImages but it seem a little complicate.
Thanks ;)
Unless you want to compute 3D fractals (in which case a library like JOGL Java OpenGL can help), a simple java.awt.Graphics.setColor( java.awt.Color aColor) is enough.
(as show in this program).
In other word, the default awt library in Java should be up to the task: see "Graphics: setColor(Color c)".
I have implemented both mandelbrot and the flame fractal algorithm in native java (no openGL).
The most efficient way is to just store color in an int array or similar,
and then save it as an image file (png or jpg). It is much quicker than using Graphics.
I need a suggestion/idea how to create a 3D Tag Cloud in Java (Swing)
(exactly like shown here: http://www.adesblog.com/2008/08/27/wp-cumulus-plugin/)
, could you help, please?
I'd go either with Swing and Java2D or OpenGL (JOGL).
I used OpenGL few times and drawing text is easy using JOGL's extenstions (TextRenderer).
If you choose Swing, than the hard part will be implementation of a 3D transformation. You'd have to write some sort of particle system. The particles would have to reside on a 3D sphere. You personally would be responsible of doing any 3D transformation, but using orthogonal projection that would be trivial. So it's a nice exercise - what You need is here: Wiki's spherical coord sys and here 3d to 2d projection.
After You made all of the transformation only drawing is left. And Java2D and Swing have very convenient API for this. It would boil down to pick font size and draw text at given coordinates. Custom JPanel with overriden paintComponent method would be enough to start and finish.
As for the second choice the hardest part is OpenGL API itself. It's procedural so if You're familiar mostly with Java You would have hard time using non-OO stuff. It can get used to and, to be honest, can be quite rewarding since You can do a lot with it. If you picked OpenGL than you would get all the 3D transformations for free, but still have to transform from spherical coordinate system to cartesian by yourself (first wiki article still helpful). After that it's just a matter of using some text drawing class, such as TextRenderer that comes with JOGL distribution.
So OpenGL helps You with view projection calculations and is hardware accelerated. The Java2D would require more math to use, but in my opinion, this approach seems a bit easier. Oh, and by the way - the Java2D tries to use any graphic acceleration there is (OpenGL or DirectDraw) internally. So You are shielded from certain low-level problems.
For both options You need also to bind mouse coordinates s to rotational speed of sphere. Whether it's Java2D or OpenGL the code will look very similar. Just map mouse coordinates related to the center of panel to some speed vector. At the drawing time You could use the vector to rotate the sphere accordingly.
And one more thing: if You would want to try OpenGL I'd recommend: Processing language created on MIT especially for rich graphic applets. Their 3D API, not so coincidentally, is almost the same as OpenGL, but without much of the cruft. So if You want the quickest prototype that's the best bet. Consult this discussion thread for actual example. Note: Processing is written in Java.
That's not really 3D. There are no perspective transformations or mapping the text on some 3D shape (such as, say, a sphere). What you have is a bunch of strings where each string has an associated depth (or Z order). Strings "closer" to you are painted with a stronger shade of gray and larger font size.
The motion of each string as you move the mouse is indeed a 3D shape which looks like a slanted circle around a fixed center - with the slant depending on where the mouse cursor is. That's simple math - if you figure it for one string, you figure it out for all. And then the last piece would be to scatter the strings so that they don't overlap too much, and give each one the initial weight based on their frequency.
That's what most of the code is doing. So you need to either do the math, or translate the ActionScript to Java2D blindly. And no, there is no need for JOGL.
Why don't you just download the source code, and have a look? Even if you can't write PHP, it should still be possible to read it and figure out how the algorithm works.