Large Category

Home » Large Category

Simple 3D graphics using Java

Isometric or Orthogonal 3D views In this article, I demonstrate 3D Graphics showing you how to project a surface in 3D using 3 modes for drawing the surface. There is a left-hand mode, a center mode, and a right-hand mode. This same transformation math works for 3D polyhedron objects as well and you could use if for voxel type games. I show some effects you can use on the surface such as zoom, pan, skew etc. This is entirely wire frame. I do not remove hidden lines. I do not fill or texture map. And I do not rotate. I may do all this in future versions of this article. 90-degree rotation is very easy to do. Using basic trigonometry math more fine rotation is not difficult. The Iso3D class I did not have to put this code in its own class. As a matter of fact, in such a simple demo applicati...

Sound effects and Musical Notes.

Sound Effects and Musical Notes I will demo how to play a wave file or other sound files as effects. How to play musical notes. Later I will write on how to play music files simultaneously with sound effects.  There is a website that is like a YouTube for sound effects. freesound.org is a website where anyone can get an account to upload sound effects that they have recorded. So you too can record and contribute.  Sox Wikipedia and Sox Sourceforge is a command line sound conversion tool where you may convert most any format found on freesound.org to .wav for use in your Java software. Listen to my Podcast about 2D Game coding. Playing WAV Sound Effects I now show you how to play some sound effects. I have a small collection of wave files for a beaver trapping game. One of the files threw a...

Database: H2 (formerly HypersonicSQL)

H2 Database and Java When I began using Java years ago I heard of a database that was being coded entirely using Java. This was HypersonicSQL and you can still download it at Sourceforge. The author working on it decided it needed a rewrite and he began H2 database. First download H2 installer at H2 download.  Get the stable version 1.4.195 as the h2 jar file for the last version .196 gave a class not found exception on startup looking for the driver. And the tutorial can be found here H2 Tutorial.  Next look at your install and find the H2/bin folder. Here you find the jar file needed h2-some-version.jar i.e. h2-1.4.195.jar. Most if not all databases now create the database when you connect to it. All we need to do is make the JDBC connection and create a table, add some records with SQL ...

SQLite: JDBC and SQLite

SQLite and Java First, you must go to download page and get the binaries for either 32 or 64 bit, placing them in the system path. If you don't know how to do that, google adding folders to the system path. There will be an SQLite.exe file. Run it as a command to verify that it is in the path and working. But for Java coding get the jar file at Jar file. A very good resource you will need is A good tutorial and Another tutorial. Working with Java and Files Tutorial Trail Serialize Java to XML H2 DB and Java Setup for simple example Download the SQLite jar file from BitBucket SQL downloads. Put it and the source below in the same folder. Set the classpath to include that jar file and the '.' current folder or use -cp option with 'sqlite-jdbc-3.21.0.jar;.' when using java.exe. One Step Creat...

Changes: Software Developer Zone Podcast Episode 9-Changes and Plans

Newest Changes and Plans Arksoft.org----->Softwaredeveloperzone.com I talk about the changes and plans with the changeover from Arksoft.org to SoftwareDeveloperZone.com and new plans. The new domain, theme, layouts, and features. New post and tutorial trail. Upcoming Post and plans. New marketing plans for how to use paid subscription levels. New plans for how I will use the now SDZ Golf Rating System. Maybe seeking a few co or guest authors. See the first podcast About Arksoft RSS feed is http://arksoft.libsyn.com/rss  

Serializing Java Objects to XML and Deserializing XML back to Java Objects

Like object serialization this is very easy and straight forward. Below is two examples of psuedo code for writing and then reading. This code merely shows the steps. We didn't have to use the buffered streams. With small files you do not have to but with larger files it will speed up reading and writing. XMLEncoder Class //psuedo code does not run import java.beans.*; import java.io.*; public class SerializeToXML { public static void main(String args[]){ // an object, composition of objects or collection of objects AnObject anObject = new AnObject(); XMLEncoder encoder=null; try{ encoder=new XMLEncoder(new BufferedOutputStream(new FileOutputStream("objects.xml"))); }catch(FileNotFoundException fnfe){ fnfe.printStackTrace(); } encoder.writeObject(anObject); encoder.close(); } } //psuedo co...