Saturday, May 18, 2013

Env3D at the Vancouver Android Meetup

Vandrico, in partnership with the Vancouver Android Developer meetup group is hosting an env3d meetup on June 5, 2013.  I will be doing a small presentation followed by hands-on demo on how to create play store ready android apps using env3d.  If you live in the Greater Vancouver area, we would love to have you come out and meet us in person, try out the development tools, and chat over beers! 

Thursday, May 16, 2013

First env3d android app available on the google play store!

After months of hard work testing the android deployment option, we are thrilled to release our first env3d demo app on the Google play store!  It is a free app and you can get it at https://play.google.com/store/apps/details?id=com.vandrico.demo1.  We want to thank Vandrico Solutions for sponsoring this activity, as well as the on going hosting of env3d website.

Of course this is only a demo app, but proves that it is now possible to go from 0 to app store in less than 5 minutes!  The only limit is your imagination!  To create an apk file that you can submit to the app store, simply select the “Create Android Package (Release)” option from the “Env3D Deploy Menu”.


Another major update is that the Android deploy options are now available for the NetBeans plugin.  So user can choose to work in either BlueJ or NetBeans environments.


Coming soon: a video tutorial on using the NetBeans plugin to create env3d android apps!  Stay tuned :D

Wednesday, December 19, 2012

Using Scene Creator to create android apps

A new set of lessons on writing android apps are now available!  You can find them on the env3d website under the "Lessons->Android", or simply follow this link: http://www.env3d.org/beta/env3dandroidlessons

One of the beneficial side-effects of incorporating android support to env3d is that users can now use the Scene Creator to create nice looking 3D apps with a drag-and-drop interface.  Here is a short video to illustrate how easy the process is:


Happy programming!

Friday, November 30, 2012

Creating Executables

One of the overwhelming env3d feature request is to include the ability to create OS specific executables.  While env3d has had the ability to create applets for some time, the use of Java applets have been in decline in the last decade as applets have been plagued with poor browser support and security issues.  I believe that it is now time to move on and I have completed the first implementation of deploying semi-native executables (I'll explain the "semi" part later).

To use this new feature, download the latest version of env3d (http://sourceforge.net/projects/env3d/files/env3d_template.zip/download) and open it in BlueJ.  After writing your env3d application, make sure you include a "main" method in your Game class, as follows:

If you are using the scene creator feature, the main method is already included by default.

All you have to do now is to right click on the Game class in BlueJ and a new option would appear in the Env3D menu:


When you click on the "Create distribution jar file" item, a new window will appear showing you the entire packaging process.  From the screenshot below, you can see that first, a "jar" file is created, then the Windows EXE file is created, followed by the MacOS executable.  You can click on the "Dismiss" button once the MacOS executable is finished.


To find your executable files, go into the project folder.  You'll see a "dist" folder is now created.  Inside the "dist" folder are 3 files:  env3d_template.jar, env3d_template.exe, and env3d_template-macOSX.zip


That's pretty much it, you now have 3 types of executables to use.  The zip file contains the executable for the Mac, the .exe file is for windows, and the jar file is for any OS including Linux. 

Technology

The technology that makes creating windows exe possible is called lanuch4j (http://launch4j.sourceforge.net/).  It is basically an exe wrapper that looks for the locally installed JVM and use it to launch your program.  Therefore, your user will still need to have at least the Java JRE installed in order for the exe to work.  If the JRE is not found on the user's system, it will prompt the user to download one.

As far as the Mac executable is concerned, OSX will automatically prompt the user to download Java if it is not already installed.

Have fun using this new feature and let me know if you find any bugs.  Stay tuned because the Android deployment option is coming real soon! :)

Wednesday, July 25, 2012

Env3D on Android - sneak preview

I finally got a hold of an android device for testing (a samsung galaxy 10.2 tab).  So I can finally start to work on putting Env3D on Android.  Here is what I have so far:


It's far from being finished, but at least it is a start.  There are lots of little details that need to be worked out.  Hopefully I will have something ready by September!

Wednesday, February 1, 2012

Scene Creator is now available for NetBeans

Due to popular demand, I have updated the Env3D NetBeans plugin to include support for the Scene Creator!  Check out the following video for an overview of this feature...


Wednesday, November 2, 2011

Introducing: the Env3D Scene Creator

It started out as a small bug fix to the "Start Env3D" visualization tool, and quickly evolved into a full blown framework and code generation tool.  The new Scene Creator in Env3D has to ability to setup a scene in env3d using drag and drop instead of creating and placing the objects in code  -- allowing students to create nicer looking games in a fraction of the time.  Furthermore, all the learning objectives are enhanced by allowing students to examine and modify generated source code.

Inspiration

I have always wanted to integrate drag-and-drop functionality into env3d -- it just makes so much more sense than placing objects in code using a series of env.addObject(...) calls.  The idea really came from Alice - a complete drag-and-drop 3D programming environment.  While Alice is wonderful tool for students learning to program for the first time, the drawback of Alice, in my opinion, is that students are limited to drag and drop, so it is not very suitable for non-beginners trying to write more complex software. 

Another wonderful piece of software from the BlueJ team - Greenfoot, takes a different approach.  It is a 2D programming environment with some drag-and-drop support.  The major difference between Greenfoot and Alice is that students actually learn how to program in Java.  Greenfoot simply provides drag-and-drop support for placement of objects, and a framework so that students can focus on programming individual objects instead of creating everything from scratch.

The Scene Creator in Env3D takes inspiration from both Alice and Greenfoot.  It has a 3D drag-and-drop interface for object placement, but generates a Greenfoot-like framework where students must customize using Java.  I suppose this could be a "best-of-both-worlds" solution, at least from my point of view :)

Getting started

To get started, download the latest development version of env3d_template.zip and extract to a directory of your choice.  Then start BlueJ and open the extracted directory (which is a BlueJ project).

After the env3d_template project is opened, go to the tools menu and select Env3D, you'll find the "Env3D Scene Creator" option available.


If this is your first time, you'll be presented with a black window and a few drop down menu items across the top.
The first 3 drop-down menus allows you to choose the background, the ground type, the third one allows you to drop a model into the environment.  Probably best to show how it works with a video:


Feel free to change the background and the ground at any time, I have included lots of different backgrounds and floor textures.  They are located in the "textures/skybox" and "textures/floor" directory if you want to add to or remove from it.

The most exciting part is of course adding models.  The scene creator scans the models/ directory for appropriate models.  Once you have chosen the model from the models drop-down menu, you are entered into "Object Edit Mode" where the mouse will be grabbed by the 3D window.  In edit mode, you navigate with W, A, S, D keys for movement, and the mouse for looking around (just like a modern video game).  When an object is selected, it will be shown in wireframe.  You can use the UP and DOWN arrows keys to resize the object, and the LEFT and RIGHT arrow keys to rotate the obejct.  Clicking on the mouse will place the currently selected object into the environment.  Pressing ESCAPE will take you out of edit mode and you get your mouse back.

Generating Code

When you hit the save button, the code will be generated in the BlueJ project.  Each model is one class, and is inherited from the GameObject class (for the Greenfoot users, this is roughly equivalent to the Actor class in Greenfoot).  The Game class is where the game can be launched.

The GameObject class has an empty method called move().  This move() method is called every frame of the game, so various animations and game logic can be implemented by overriding the move() method in sub-classes, as shown in the above video.

Conclusion

That's it for our basic tour of the Env3D Scene Creator.  Read the code to the GameObject class and the Game class for an idea of how the framework is setup (it is very similar to the Greenfoot framework).

There are lots more to the Scene Creator, including support for animated models, that is not covered by this introductory article.  I will be posting more articles soon, so stay tuned!

Labels: , , , , , , ,