How to create and rotate tridimensional matrix in Java or AS3 - java

i'm currently working on a personal project and i need to save short ints in a tridimensional array (cube) that allows me to "rotate" the cube and change its orientation (of course i just mean the values inside the matrix). Also i would need to make displacements (translations) of all the values towards one of the axis. Is there a premade way to do this? If it's a java or as3 solution approach it would be nice since i feel more comfortable on one of those technologies.
Thank you in advance for your time!

There is a Vector3D and Matrix3D classes in AS3. Use what you need :)

Related

Custom 3D graphics engine... where to plot Z coordinate

I'm brainstorming a way to create a basic custom 3D engine by myself and it's all very new to me, as I've only practiced 2D graphics.
Assuming that we have calculations for a Z coordinate using the recommended formulas given here, how might I go about plotting the Z coordinate? I understand that by default, Java graphics draw on a 2D field, which means that the only coordinates I can draw to is either the X or Y coordinate... and that's where I'm stuck.
3D development is not taught in my college... so I really appreciate good feedback. The tutors here never practiced creating 3D engines, so I'm very frustrated because learning this concept is crucial.
In order to map 3D coordinates to a 2D plane (the screen) you'll need to understand the concept of the Frustum and how to utilize a Projection Matrix.
This article does an excellent job of explaining what it does and how to implement one. Writing your own engine for this seems to be a massive undertaking and assumes you understand the vector and matrix mathematics. If not, I would suggest doing some reading on linear algebra; it's fundamental to this kind of programming.
If you'd like to work with some already established technologies, look into OpenGL for Java.
I know how to make a 3d program in English but not in code.
If you would like to make one, please let me know. So I can see how active you are.
Oh my apologies. I didn't answer*. Let me elaborate on your predicament.
Z axis doesn't exist. It's an illusion. You need to produce a procedural code to establish this illusion.

Square BoundingBox with OpenGL JOGL Java

I'm trying to make a project in OpenGL using JOGL.
If you see my image http://imgur.com/DDHoXEz, I have 4 viewports with different projections but all Teapots are out of "scale", and I want to make something like a bounding box, a square with side 1, that contains all objects on the viewports, to make a scale out of the square.
Any tips?
Unless you're going to use the base teapot model for programs (which you shouldn't), I don't think this is something to spend your time on. When you get into actually using your own models, you will have direct control over the scale.
I would recommend at this point learning about different drawing methods in OpenGL (e.g., GL_TRIANGLE_FAN, GL_LINE_LOOP). Then move on to learning about vertex arrays and maybe write an OBJ importer. I can point you in the right direction if you'd like.
Here is a good place to get started on different drawing techniques.
Happy coding!

Creating a horizontal histogram in java

So I have a data file with points to make a histogram. I have no idea how I would do this. I in a first year java course and am supposed to make 'bins' and count how many of each point fall into each bin. Thanks
I'm unclear what your real objective is. Do you have to write a graphical histogram, or a text-based histogram (easy for a horizontal histogram), or make use of an existing library.
You can use the open-source JFreechart to create a histogram.

Cut out parts of the cone in java3d

I want to cut out top of the Primitive Cone in java3d and i want to get rid of the bottom part so I can have a lamp cover that looks something like this: http://www.lulusoso.com/upload/20110604/2010_Replacement_Lamp_Cover.jpg
How can I do this?
Thanks,
Eugene.
You could try and do some boolen shape operations on the cone but I'm not sure it would be easier than just creating a new shape by defining two rings of vertices and connect them to form triangles.
Accessing and modifying the default cone shape might be harder than it seems, but I'm not sure about this. I never tried because creating my own shapes directly was easier :)
There's some math involved to calculate the positions of the vertices but I guess that's what your homework is really about. It's actually not that hard with a bit of sine/cosine usage and you'd most probably get some easier to read and understand code as well as potentially better visual results.

Simplest way to get a polygon from Illustrator to Java?

What's the simplest way to get a polygon (doesn't need curves etc, just an array of points) from Illustrator (or any other vector graphics program, for that matter) into a Java Polygon object?
I'm not really eager to implement a very heavy SVG class, my app needs to be as light-weight as possible.
I know it's a very wide question, but so may your answers be. Thanks in advance, guys.
You might want to try "FXG Converter (webstart)" (http://idisk.mac.com/han.solo-Public/fxgconverter.jnlp) from http://harmoniccode.blogspot.com/.

Categories