StdDraw3D

StdDraw3D: Importing StdDraw3D

Introduction

In this tutorial we will be importing the StdDraw3D class into a new project and making a sphere appear on the screen.

What You Will Need to Start

For this tutorial you will need to have completed the basic setup for a Java3D application, you will need to import all of the libraries that Java3D applications require. If you haven’t done that and don’t know how to do that, click here to find out how.

Implementation

Now, you’re going to need the source code for the StdDraw class. Click here to get the StdDraw.java code. In your IDE create a new class and call it “StdDraw3D”. Delete all of the code in that class and copy the code from the StdDraw.java from the link above.

Now create a new class, call this class “Main”.  Create a main method within this class and write these three lines of code within the main method.

a54d76a62cc04960adec91952ec5b808

Now run the application and you should see a sphere being outputted to the screen.

206b51d4a1e64a75b18f5e761e147f42

That is it, as you can see this is a much simpler way of creating quick Java3D applications. I advise you to read through the methods within the StdDraw3D class and maybe render some different shapes to the screen.

In the next tutorial we will look into animation and positioning objects within 3D space.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s