Showing newest 12 of 23 posts from January 2009. Show older posts
Showing newest 12 of 23 posts from January 2009. Show older posts

Saturday, January 24, 2009

iMagic OS Sapphire PC

Are you looking to purchase a new computer? You should consider purchasing an iMagic OS Netbook. This computer is based on the Linux operating system so your system will always be virus free. You will have the three of the strongest firewalls available so you won't have to worry about any security issues. They have improved installation tools which will allow you to install any software with a single click. When you purchase this computer, you will already have many software packages already installed. Another great thing about an iMagic OS is that it is inexpensive, and it will allow you to run many of the Windows applications. The iMagic OS Sapphire PC Netbook is only $349 and it includes the Intel Atom 1.60GHz Processor with 1GB DDR2 of memory. You will have 120GB hard drive, and a 3MP Webcam built in along with a built in microphone. The desktop has been improved along with the 3D effects. The graphical themes have also been improved. When you purchase this computer, you will also get the 1 month magicOnline trial included. So if you are looking for a great computer experience, you should consider purchasing an iMagic computer. I am sure you won't be disappointed.

Read more...

JME Mouse Movement #10

In this post I am going to show you how to move the camera with the mouse. I only want to allow the user to move the camera from left to right, and not up and down. I am going to use the FirstPersonHandler class. This class contains a class called MouseLookHandler and with this class you are suppose to be able to lock the axis. However, this doesn't let me lock the axis in the y direction. When I look at the code, I only see the the rotateLeft and the rotateRight lockable.

rotateLeft.setLockAxis(lockAxis);
rotateRight.setLockAxis(lockAxis);

Therefore, I modified the code so the camera won't rotate in the y direction.

This is the modified FirstPersonHandler class. The only difference is that I changed the MouseLookHandler to be my modified MouseLookHandler.

NewFirstPersonHandler.java


/*
* Copyright (c) 2003-2006 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.guid.asteroid3D;

import com.jme.input.InputHandler;
import com.jme.input.KeyboardLookHandler;
import com.jme.input.MouseLookHandler;
import com.jme.renderer.Camera;

/**
* <code>FirsPersonController</code> defines an InputHandler that sets
* input to be controlled similar to First Person Shooting games. By default the
* commands are, WSAD moves the camera forward, backward and strafes. The
* arrow keys rotate and tilt the camera and the mouse also rotates and tilts
* the camera. <br>
* This is a handler that is composed from {@link KeyboardLookHandler} and {@link MouseLookHandler}.
* @author Mark Powell
* @version $Id: FirstPersonHandler.java,v 1.17 2007/08/26 08:44:20 irrisor Exp $
*/
public class NewFirstPersonHandler extends InputHandler {
private NewMouseLookHandler mouseLookHandler;
private KeyboardLookHandler keyboardLookHandler;

/**
* @return handler for keyboard controls
*/
public KeyboardLookHandler getKeyboardLookHandler() {
return keyboardLookHandler;
}

/**
* @return handler for mouse controls
*/
public NewMouseLookHandler getMouseLookHandler() {
return mouseLookHandler;
}

public void setButtonPressRequired(boolean value) {
mouseLookHandler.requireButtonPress(value);
}

/**
* Creates a first person handler.
* @param cam The camera to move by this handler.
*/
public NewFirstPersonHandler( Camera cam ) {
mouseLookHandler = new NewMouseLookHandler( cam, 1 );
addToAttachedHandlers( mouseLookHandler );
keyboardLookHandler = new KeyboardLookHandler( cam, 0.5f, 0.01f );
addToAttachedHandlers( keyboardLookHandler );
}

/**
* Creates a first person handler.
* @param cam The camera to move by this handler.
* @param moveSpeed action speed for move actions
* @param turnSpeed action speed for rotating actions
*/
public NewFirstPersonHandler(Camera cam, float moveSpeed, float turnSpeed ) {
mouseLookHandler = new NewMouseLookHandler( cam, turnSpeed );
addToAttachedHandlers( mouseLookHandler );
keyboardLookHandler = new KeyboardLookHandler( cam, moveSpeed, turnSpeed );
addToAttachedHandlers( keyboardLookHandler );
}
}



In the NewMouseLookHandler class, the only thing I changed was the MouseLook. I am using my modified MouseLook class.

NewMouseLookHandler.java

package com.guid.asteroid3D;

/*
* Copyright (c) 2003-2006 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/



import com.jme.input.InputHandler;
import com.jme.input.RelativeMouse;
import com.jme.input.action.MouseLook;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;

/**
* <code>MouseLookHandler</code> defines an InputHandler that allows to rotate the camera via the mouse.
*/
public class NewMouseLookHandler extends InputHandler {

private NewMouseLook mouseLook;

public NewMouseLookHandler( Camera cam, float speed ) {
RelativeMouse mouse = new RelativeMouse("Mouse Input");
mouse.registerWithInputHandler( this );

mouseLook = new NewMouseLook(mouse, cam, speed );
mouseLook.setLockAxis(new Vector3f(cam.getUp()));
addAction(mouseLook);
}

public void requireButtonPress(boolean value) {
mouseLook.setButtonPressRequired(value);
}

public void setLockAxis(Vector3f lock) {
mouseLook.setLockAxis(new Vector3f(lock));
}

public MouseLook getMouseLook() {
return mouseLook;
}
}




This is the class that I modified. The only thing I changed was to set the mouse y axis to 0 so the user can't move the mouse in the y direction.

NewMouseLook.java

package com.guid.asteroid3D;

import com.jme.input.Mouse;
import com.jme.input.action.InputActionEvent;
import com.jme.input.action.MouseLook;
import com.jme.renderer.Camera;

public class NewMouseLook extends MouseLook{

public NewMouseLook(Mouse mouse, Camera camera, float speed) {
super(mouse, camera, speed);

}

public void performAction(InputActionEvent evt) {
super.mouse.getLocalTranslation().y=0;
super.performAction(evt);

}

}




In your Asteroid3DGame.java class, add this global variable: private InputHandler handler=null;

In the initGame method in your Asteroid3DGame.java class, you should add this coded.

NewFirstPersonHandler fpHandler = new NewFirstPersonHandler( cam, 50, 1 );
fpHandler.getKeyboardLookHandler().setEnabled( false );
fpHandler.getMouseLookHandler().setEnabled( true);
fpHandler.getMouseLookHandler().requireButtonPress(true);
handler = fpHandler;


This code will create the FirstPerson camera that will allow the scene to move with the mouse only in the x direction.

In your update method, you should also add this code to update your handler.
handler.update(interpolation);




Go To #11

Read more...

Friday, January 23, 2009

My Disclosure Policy

This policy is valid from 23 January 2009



This blog is a personal blog written and edited by me. This blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation.

The compensation received will never influence the content, topics or posts made in this blog. All advertising is in the form of advertisements generated by a third party ad network. Those advertisements will be identified as paid advertisements.

The owner(s) of this blog is compensated to provide opinion on products, services, websites and various other topics. Even though the owner(s) of this blog receives compensation for our posts or advertisements, we always give our honest opinions, findings, beliefs, or experiences on those topics or products. The views and opinions expressed on this blog are purely the bloggers' own. Any product claim, statistic, quote or other representation about a product or service should be verified with the manufacturer, provider or party in question.

This blog does not contain any content which might present a conflict of interest.


To get your own policy, go to http://www.disclosurepolicy.org

Read more...

Tuesday, January 20, 2009

Asteroids in Java 2D Part 21 Conclusion



This class contains the game logic. It also contains the timer which will keep the game constantly updating. It will add the objects to the world which is contained in a Vector class. I didn't complete everything in this game so I will leave that for you to complete.




AsteroidGame.java

import java.util.*;
import javax.swing.Timer;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;
import java.util.Random;


public class AsteroidGame implements ActionListener
{

private Vector world;
private static int[] total; //keeps track of the total
private int difficulty; //0-missiles, 1-asteroids
//2-ships,3-space mines


private boolean sound;
private int time; //increments the timer
private Timer myTimer; //timer for the game clock
private GFrame menu; //creates GUI Frame
private int score; //keeps track of score

private boolean start; //if the game is on start/pause
private int timerDelay;

private final int DELAY_IN_MSEC=20; //clock Delay

private boolean gameStarted; //keeps track if game has started or not
private int gameCount;
private boolean newGame;
private int difficultyCount;
private int newgameCount;
private int SpaceID;
private int shipamount;

private boolean continueg;
private int tempDifficulty;

private int highscore;
private String highname;


//************** STATIC VARIABLES ***********************
static final String FILE_NAME = "C:\\Users\\owner\\GregJava\\workspace\\Asteroids\\src\\score.txt";
//*********************Constructor***********************

public AsteroidGame()
{
highscore=0;
highname="";
tempDifficulty=0;
continueg=false;
shipamount=3;
SpaceID=50;
newgameCount=0;
newGame=false;
gameCount=0;
timerDelay=0;
total=new int[4];
total[0]=0;
total[1]=0;
total[2]=0;
total[3]=0;
world=new Vector();
difficulty=1;
sound=true;
start=true;
difficultyCount=10;


//****Timer set up***************************
myTimer=new Timer(DELAY_IN_MSEC,this);

time=0;
score=0;


}//end constructor

//************************createGame Method****************
//purpose: To create the Asteroid Game
//preconditions: none
//postconditions: Instantiates the GFrame to play the
// asteroid game
//********************************************************
//keeps track of the total

public void createGame()
{
menu=new GFrame(this);
gameStarted=false;


try
{
BufferedReader inFileStream =
new BufferedReader(new FileReader(FILE_NAME));
String temp=inFileStream.readLine();
highscore=Integer.parseInt(temp);
highname=inFileStream.readLine();

inFileStream.close();
}
catch(Exception e)
{
System.out.println("HighScore not found");
}

myTimer.start();
}

public boolean returngameStarted()
{
return gameStarted;
}

public void setBegin()
{
gameStarted=true;
}

//************************returnTotal Method**************
//purpose: to return the totals 0-missiles, 1-asteroids,
// and 2-ships
//preconditions: none
//postconditions: return int array
//********************************************************
public int[] returnTotal()
{
return total;
}

//************************returnSound Method**************
//purpose: to return the sound counter
//preconditions: none
//postconditions: return boolean for sound
//********************************************************
public boolean returnSound()
{
return sound;
}

//************************updateDifficulty Method***********
//purpose: to update the difficulty counter
//preconditions: passes in new difficulty level
//postconditions: updates difficulty counter
//*********************************************************
public void updateDifficulty(int d)
{
difficulty=d;
difficultyCount=(difficulty*10);
}

//************************returnDifficulty Method***********
//purpose: to return the Difficulty counter
//preconditions: none
//postconditions: returns int, the difficulty counter
//*********************************************************
public int returnDifficulty()
{
return difficulty;
}

//************************decrementTotal Method************
//purpose: to decrement either 0-missiles, 1-asteroids,
// or 2-ships
//preconditions: array item to decrement
//postconditions: decrements missile, asteroid, or ship
// counter
//********************************************************
public void decrementTotal(int d)
{
total[d]-=1;
}

//************************incrementTotal Method************
//purpose: to increment an item 0-missiles, 1-asteroids,
// 2-ships
//preconditions: int to increment
//postconditions: none
//*********************************************************
public void incrementTotal(int i)
{
total[i] +=1;
if(i==2)
shipamount++ ;
}

//************************newGame Method*****************
//purpose: to reset the total counts
//preconditions: none
//postconditions: resets all the counts for missiles, ships,
// and asteroids
//**********************************************************&^&^&^&^&^&^&
public void newGame()
{
total[0]=0;
total[1]=0;
total[2]=0;
world.clear();
time=0;
score=0;
SpaceID=50;
shipamount=3;
gameCount=0;
newGame=true;
newgameCount=0;
tempDifficulty=(difficulty*2);
difficultyCount=(difficulty*20);

}

public void continueGame()
{
total[1]=0;
newGame=true;
newgameCount=0;
continueg=true;
tempDifficulty ++ ;
if(tempDifficulty>10)
tempDifficulty=10;
difficultyCount=(tempDifficulty*20);


}

//************************addScore Method*****************
//purpose: to add scores to the game
//preconditions: amount to be added, int
//postconditions: none
//**********************************************************

public void addScore(int z)
{
score =z;
}

//************************startGame Method*****************
//purpose:to start the game
//preconditions: none
//postconditions: returns void
//**********************************************************

public void startGame()
{
start=true;
}

//************************stopGame Method*****************
//purpose: to pause the game
//preconditions: none
//postconditions: none, pauses the game
//**********************************************************

public void stopGame()
{
start=false;
}

//************************returnStart Method*****************
//purpose: to return if game is on or off
//preconditions: none
//postconditions: returns boolean
//**********************************************************

public boolean returnStart()
{
return start;
}

//************************updateSound Method*****************
//purpose: to update the sound counter, if sound is on or off
//preconditions: none
//postconditions: updates the sound counter, pass in boolean
//**********************************************************

public void updateSound(boolean s)
{
sound=s;
}

//************************addElement Method*****************
//purpose: to add an object to the world
//preconditions: send in a valid object to add to the world
//postconditions: to add an object to the world
//***********************************************************

public void addElement(Object add)
{
world.addElement(add);
}

//************************isEmpty Method*******************
//purpose: to check if world is empty
//preconditions: none
//postconditions: returns boolean if world is empty or not
//*********************************************************

public boolean isEmpty()
{
return world.isEmpty();
}

//************************size Method**********************
//purpose: to returns the world's size
//preconditions: none
//postconditions: returns int, which is worlds size
//**********************************************************

public int size()
{
return world.size();
}

//************************elementAt Method*******************
//purpose: to return object at the specified location
//preconditions: sends in int to specify the location
//postconditions: returns Object at that location
//**********************************************************

public Object elementAt(int x)
{
return world.elementAt(x);
}

//************************removeElement Method**************
//purpose: to remove element from world
//preconditions: Object to be removed
//postconditions: none
//**********************************************************

public void removeElement(Object q)
{

world.removeElement(q);

}

public String returnhighName()
{
return highname;
}
public int returnhighScore()
{
return highscore;
}

//************************tick Method*********************
//purpose: to subtract one from each missle object and remove
// it when it is at zero
//preconditions: sends in current amount to be ticked
//postconditions: none
//***********************************************************

public void tick()
{
if(!(world.isEmpty()))
{
Missiles m;

int z=world.size();
for(int y=0;y<z;y++ )
{

if(world.elementAt(y) instanceof Missiles)
{

m=(Missiles)(world.elementAt(y));
m.decrementPower(); //subtracting one
//from the power

if(m.returnPower()==0)
{
total[0]--;
world.removeElement(m);
z--;
y--;

}
}

}//end for statement

}

//return totalm;
}

//************************timerListener method********************
//purpose: to listen for the timer events
//preconditions: ActionEvent
//postconditions: will update status panel according to the time
//****************************************************************

public void actionPerformed(ActionEvent e)
{
//******HIGH SCORE********
if((total[2]==0)&&(!newGame))
{
if(shipamount==1) //game over when ship amount uses last ship
{ gameStarted=false;
shipamount--;
if(score>highscore)
{
highscore=score;
highname=JOptionPane.showInputDialog("Enter name for new Highscore");
try
{
PrintWriter outFileStream =
new PrintWriter(new FileOutputStream(FILE_NAME));
outFileStream.println(highscore);
outFileStream.println(highname);
outFileStream.close();
}
catch(Exception exception)
{
System.out.println("HighScore file not found");
}
}//end highscore if

}
else if(gameStarted)
{ total[2]++ ;
Ships ship8=new Ships(menu.getWidth(),menu.getHeight());
ship8.setSelected(true);
this.addElement(ship8);
shipamount--;

}
}

if((total[1]==0)&&(!newGame))
{

this.continueGame();
}

//asteroids for the game when it isn't started
if(!gameStarted)
{
if(gameCount<40)
{
Asteroids gs=new Asteroids(menu.getWidth(),menu.getHeight());
this.addElement(gs);
gameCount ++ ;
total[1]++ ;
}
}

if(newGame)
{

if(newgameCount<difficultyCount) //adds asteroids to game according to
{ //difficulty level
Asteroids as=new Asteroids(menu.getWidth(),menu.getHeight());
this.addElement(as);
total[1] ++ ;
}
if(newgameCount<tempDifficulty) //adds spacemines to game
{
SpaceMines sp=new SpaceMines(menu.getWidth(),menu.getHeight());
SpaceID++ ;
sp.setID(SpaceID);
this.addElement(sp);
}
if(newgameCount==difficultyCount)
{
newGame=false;
if(!continueg)
{
total[2]++ ;
Ships ship=new Ships(menu.getWidth(),menu.getHeight());
ship.setSelected(true);
this.addElement(ship);
}
continueg=false;
}
newgameCount++ ;

}//end if newgame

if(start)
{

String temp1=new String();

if(timerDelay==20)
{
time++ ; //clock timer for seconds
timerDelay=0;
}


if (sound==true)
temp1=("Sound: On Missiles " total[0] " Asteroids " total[1] " Ships " shipamount " Difficulty Level " difficulty " Score " score " Time: " time);
else
temp1=("Sound: Off Missiles " total[0] " Asteroids " total[1] " Ships " shipamount " Difficulty Level " difficulty " Score " score " Time: " time);


//adding Enemy Ship
if(gameStarted)
{
int yui=50;
yui=(yui-(difficulty*3));
if(time==yui)
{
EnemyShip enemy=new EnemyShip(menu.getWidth(),menu.getHeight(),world);
this.addElement(enemy);
}


}


menu.setStatus(temp1);

Missiles m;
Asteroids a;
Ships s;
SpaceMines sm;
Garbage gb;
EnemyShip enemyShip5;
Point po;

int speed=0;
Point location1=new Point();
double heading=0.0;
int height5=0;

boolean add=false;
int base5=0;

int z=world.size();

//********************MOVING OBJECTS********************

for(int y=0;y<z;y++ )
{

if(world.elementAt(y) instanceof Missiles)
{
m=(Missiles)(world.elementAt(y));
m.move(DELAY_IN_MSEC);
}
else if(world.elementAt(y) instanceof Garbage)
{
gb=(Garbage)(world.elementAt(y));
gb.move(DELAY_IN_MSEC);

if(gb.removeCollision())
{ world.removeElement(gb);
y--;
z--;
}

}

else if(world.elementAt(y) instanceof Asteroids)
{
a=(Asteroids)(world.elementAt(y));
a.move(DELAY_IN_MSEC);

if(a.removeCollision())
{ world.removeElement(a);
total[1]--;
y--;
z--;
}

}
else if(world.elementAt(y) instanceof Ships)
{
s=(Ships)(world.elementAt(y));
s.move(DELAY_IN_MSEC);

if(s.removeCollision())
{ world.removeElement(s);
y--;
z--;
total[2]--;
}
}
else if(world.elementAt(y) instanceof EnemyShip)
{
enemyShip5=(EnemyShip)(world.elementAt(y));
enemyShip5.move(DELAY_IN_MSEC);

if(enemyShip5.removeCollision())
{
world.removeElement(enemyShip5);
y--;
z--;
}


}


}//ends for statement

//*************************CHECKING FOR COLLISIONS*************
int wy=0;

for(int y=0;y<z;y++ )
{

if(world.elementAt(y) instanceof Missiles)
{
m=(Missiles)(world.elementAt(y));

for(wy=0;wy<z;wy++ )
{
if(world.elementAt(wy) instanceof Asteroids)
{
a=(Asteroids)(world.elementAt(wy));

if(a.bounds(m.getBounds1(),m.getBounds2()))
{ a.collision();
score =a.returnValue();
add=true;
speed=a.getSpeed();
location1.setLocation(a.getLocation());
base5=a.getBase();
heading=a.getHeading();

}
}//end if statement for asteroids

if(world.elementAt(wy) instanceof EnemyShip)
{
enemyShip5=(EnemyShip)(world.elementAt(wy));
if(enemyShip5.bounds(m.getBounds1(),m.getBounds2()))
{
enemyShip5.collision();
score =100;
}
}

}


}//end if statement

else if(world.elementAt(y) instanceof Asteroids)
{
a=(Asteroids)(world.elementAt(y));

for(wy=0;wy<z;wy ++ )
{
if(world.elementAt(wy) instanceof Ships)
{
s=(Ships)(world.elementAt(wy));
if(a.bounds(s.getBounds1(),s.getBounds2()))
{
s.collision();
a.collision();
score-=25; //deduct score for ship being killed
add=true;

speed=a.getSpeed();
location1.setLocation(a.getLocation());
base5=a.getBase();
height5=a.getHeight();


}
}

}


}//end if statement
else if(world.elementAt(y) instanceof SpaceMines)
{
sm=(SpaceMines)(world.elementAt(y));

for(wy=0;wy<z;wy++ )
{
if(world.elementAt(wy) instanceof Ships)
{
s=(Ships)(world.elementAt(wy));

if((s.bounds(sm.getBounds(),sm.returnHW()))&&(!sm.remove()))
{
sm.setRemove(true);
s.collision();

}
}
}

}
else if(world.elementAt(y) instanceof EnemyShip)
{

enemyShip5=(EnemyShip)(world.elementAt(y));

for(wy=0;wy<z;wy++ )
{
if(world.elementAt(wy) instanceof Ships)
{
s=(Ships)(world.elementAt(wy));

if(enemyShip5.bounds(s.getBounds1(),s.getBounds2()))
{
enemyShip5.collision();
s.collision();
score =75;

}
}
}//for statement
}//end else if for enemy ship






}//ends for statement

//*****************ADDING GARBAGE AND SMALLER ASTEROIDS******************
if(add)
{
Random myRNG=new Random();
gb=new Garbage(menu.getWidth(),menu.getHeight(),speed,location1,base5,myRNG.nextInt(359));
this.addElement(gb);
gb=new Garbage(menu.getWidth(),menu.getHeight(),speed,location1,base5,myRNG.nextInt(359));
this.addElement(gb);
gb=new Garbage(menu.getWidth(),menu.getHeight(),speed,location1,base5,myRNG.nextInt(359));
this.addElement(gb);
gb=new Garbage(menu.getWidth(),menu.getHeight(),speed,location1,base5,myRNG.nextInt(359));

height5/=2;
base5/=2;

if(!(height5<6||base5<6))
{ a=new Asteroids(menu.getWidth(),menu.getHeight(),myRNG.nextInt(359),speed,(int)location1.getX(),(int)location1.getY(),base5,height5);
total[1]++ ;
this.addElement(a);
}
}

tick();

timerDelay++ ;
}//end start or stop if statement

menu.repaintDisplay();

}//end actionperformed method


}//end AsteroidGame class


Read more...

Custom Search Homepage Service

Have you ever thought of creating a Shiny Search? This website allows you to create a custom search to look more creative then the standard Google page. This search is pretty handy because it allows you to quickly get to your important websites. They have a drop down menu to check your email. You can easily get to your AOL, hotmail and Gmail accounts. What is even more interesting is that you can quickly get to your friends accounts. They have an easy drop down menu to be able to get to your Friendster, MySpace, and Facebook accounts. They have a link to be directed to the important news resources as well. They have another drop down menu that contains a lot of other important websites. There are many choices that you can choose from to customize this search for you. You can make your search look like the God Father or maybe you want to choose the Harley Davidson customization. They have one that is the pink flower, or maybe you want it to look like a sun flower. They also have black dots, Pink Guitars and many other different designs. So what are you waiting for? If you want to make your search look a little fancier, you should visit shinysearch.com and see how you can customize your search.

Post?slot_id=

Read more...

Friday, January 16, 2009

Web Templates

Are you looking for some attractive web templates for your website? You can get some fabulous website templates at dreamtemplate.com. You can actually download unlimited number of website templates for only $59.95, and you should hurry fast because this is a limited time offer. This price includes a one year full subscription. They have over 3,000 templates to choose from, and you can even find some flash templates to pick from. You can find over 500 Microsoft Office Word Templates, over 150+ Microsoft Office PowerPoint Templates, and 15,000+ clipart, abstract images & animations. One benefit you will receive with membership is the ability to download the source files for all of the featured templates. You will have access to numerous exquisitely designed website template layouts, and you will have access to PSD files in addition to the html files for the templates. So if you are looking for a great website template, you should checkout dreamtemplate.com and see how they can help.

BuyBlogReviews.com

Read more...

Thursday, January 15, 2009

Complete Optimized Website

Are you in need of web presence or a work or art? Have you ever heard of complete optimized websites? We all know that there are small businesses around the world who paid for web design to make their online business presentable. Do you own an online business? If you are looking for a very affordable place that create entire websites for small businesses that deliver all of the results you would expect from an expensive, custom-developed site, you should check out webpresencetwo.com. This website also include free services that are known for their SEO compatibility. This sites are usually crawled within weeks of first publishing, and sometimes they're even crawled daily after that. Can you imagine getting those results from a "custom" site that the web crawlers aren't familiar with?To know more about how their service work, visit them today for more details.

Read more...

Wednesday, January 14, 2009

Automate your Testing using Ant Step 58

After you have created your suite of tests, you can add it to your ant script to automate it. This way after every build, your test will run and print the results.

Paste this code into your build.xml file:

<target name="test" >
<echo>Testing</echo>
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="class.path"/>
<formatter type="plain"/>
<test name="com.testing.WebTestSuite" haltonfailure="no" fork="yes" outfile="results">
<formatter type="xml"/>
</test>
</junit>
</target>

In my build.xml file I need to add the dependency to my clean target like this:

target name="clean" depends="test"


After I run my build.xml file, the test will run and print the results to the results file. If you want the build to stop building on failure, you can change haltonfailure="yes", and your build.xml file won't continue building if you test fail.

Go To Step 59

Read more...

Tuesday, January 13, 2009

Creating a Test Suite JUnit Step 57

After you have created your suite of tests, you will want to add them to a test suite that can be used to run all of your tests at one time.

You should create a class under com.testing package called WebTestSuite and paste the following code in that class.

package com.testing;
import junit.framework.Test;
import junit.framework.TestSuite;
public class WebTestSuite {
private static final String TEST_ROOT = "src/com/testing/";
public static Test suite() {
TestSuite suite = new TestSuite();
try
{
suite.addTestSuite(Webtest.class);
}
catch(Exception e)
{
}
return suite;
}

/**
* Runs the test suite using the textual runner.
*
* @param args command line arguments
*/
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}

}

You will run this suite the same way that you will run a JUnit test or JWebUnit test. You will add each class to the suite object like this: suite.addTestSuite(Webtest.class); . The suite will run all of your tests to make your testing automated.



Go To Step 58

Read more...

More on JWebUnit Step 56

There are many other commands you can do with JWebUnit. In our UserBook application you should add ids to the menu tree. You need to have ids properly set so JWebUnit can select on them. if you add an id on the link href="UserAction.do?action=addUser" id='test' in your header file, then you can run a test against it. After adding the id, add this test to your JWebUnit class.

tester.clickLink("test");

Now your tests will run against the add User jsp page.

You can input text into the form and submit the form like this:

tester.setTextField("newUser.firstName","Bob");
tester.setTextField("newUser.lastName","Jones");
tester.submit();


Bob Jones has now been added to the database from your test.
Go To Step 57

Read more...

Monday, January 12, 2009

Asteroids3D in Java using JME Adding Objects to Scene Tree #9



My last post I showed you how to import a ship object into your JME game.
This is my sample code that has a bunch of moving Asteroids and a fleet of moving ships from the object that you imported. Below is all of the code for the classes to create the above scenerio. The changes I added from my prior posts are listed below the code. To run this game, you should retrieve the obj file and the images I posted in my prior posts. Below is code up to this point using JME. You also might need to adjust the speed based on the speed of your computer.
You will also need the Asteroid3DStart.java, Movable.java and the MainMenu.java classed from my prior posts to run this game.

Ship.java


package com.guid.asteroid3D;


import java.util.Random;
import com.guid.asteroid3D.Movable;
import com.jme.bounding.BoundingBox;
import com.jme.math.FastMath;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.scene.TriMesh;
import com.jme.scene.state.TextureState;


public class Ship extends Node implements Movable{

private static final long serialVersionUID = 1L;
private float xlocation=0f;
private float ylocation=0f;
private float zlocation=-4000f;
private Random myRNG=null;
private int worldx=1000;
private int worldy=1000;
private TriMesh mesh=null;
private int speed=0;

public Ship(TriMesh mesh,TextureState ts1)
{ this.mesh=mesh;
this.mesh.setLocalScale(.1f);
this.mesh.setRenderState(ts1);
Quaternion rotQuat = new Quaternion();
Vector3f axis = new Vector3f(0,1,0).normalizeLocal();
float angle = 90; //TBD, prior post should change vector3f to 0,1,0 and angle to 90
rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, axis);
this.mesh.setLocalRotation(rotQuat);
this.mesh.setModelBound(new BoundingBox());

resetLocation();

}
public float getZLocation()
{
return this.zlocation;
}
public TriMesh getTriMesh()
{
return this.mesh;
}
public void move()
{
zlocation=zlocation+6+speed;
mesh.setLocalTranslation(new Vector3f(xlocation, ylocation,zlocation));
mesh.updateModelBound();

}

public void resetLocation()
{zlocation=-4000f;
myRNG=new Random();
speed=myRNG.nextInt(15);
int x=myRNG.nextInt(worldx);
int y=myRNG.nextInt(worldy);
if(xworldx/2)
{
xlocation=x/2;
}
else
{
xlocation=0;
}
if(yworldy/2)
{
ylocation=y/2;
}
else
{
ylocation=0;
}

mesh.setLocalTranslation(new Vector3f(xlocation, ylocation,zlocation));
mesh.updateModelBound();

}

}


Asteroid.java

package com.guid.asteroid3D;

import java.util.Random;

import com.jme.bounding.BoundingBox;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Sphere;
import com.guid.asteroid3D.Movable;

public class Asteroid extends Sphere implements Movable{

private static final long serialVersionUID=123l;
private float xlocation=1000f;
private float ylocation=0f;
private float zlocation=-8000f;
private Random myRNG=null;
private int worldx=8000;
private int worldy=8000;
private int speed=0;

public Asteroid()
{
super("Asteroid", 30, 30, 25);
this.setModelBound(new BoundingBox());
resetLocation();
}


public float getZLocation()
{
return this.zlocation;
}
public void move()
{
zlocation=zlocation +10 +speed;speed;
this.setLocalTranslation(new Vector3f(xlocation, ylocation,zlocation));
this.updateModelBound();

}
public void resetLocation()
{ zlocation=-8000f;
myRNG=new Random();
speed=myRNG.nextInt(15);
int x=myRNG.nextInt(worldx);
int y=myRNG.nextInt(worldy);
if(xworldx/2)
{
xlocation=x/2;
}
else
{
xlocation=0;
}
if(yworldy/2)
{
ylocation=y/2;
}
else
{
ylocation=0;
}

this.setLocalTranslation(new Vector3f(xlocation, ylocation,zlocation));

this.updateModelBound();
}

}



AsteroidConstants.java

package com.guid.asteroid3D;

public class AsteroidConstants {

public static final String LEFT="LEFT";
public static final String RIGHT="RIGHT";
public static final String UP="UP";
public static final String DOWN="DOWN";

public static final int ADDASTEROID=30;
public static final int ADDSHIP=100;
}


Asteroid3DGame.java

package com.guid.asteroid3D;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import jmetest.TutorialGuide.HelloModelLoading;
import com.jme.app.BaseGame;
import com.jme.image.Texture;
import com.jme.input.FirstPersonHandler;
import com.jme.input.InputHandler;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
import com.jme.input.action.InputAction;
import com.jme.input.action.InputActionEvent;
import com.jme.input.action.MouseInputAction;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;
import com.jme.renderer.ColorRGBA;
import com.jme.renderer.lwjgl.LWJGLRenderer;
import com.jme.scene.Node;
import com.jme.scene.Spatial;
import com.jme.scene.TriMesh;
import com.jme.scene.state.TextureState;
import com.jme.system.DisplaySystem;
import com.jme.system.JmeException;
import com.jme.util.TextureManager;
import com.jme.util.Timer;
import com.jme.util.export.binary.BinaryImporter;
import com.jmex.model.converters.FormatConverter;
import com.jmex.model.converters.ObjToJme;


public class Asteroid3DGame extends BaseGame {

private int width, height, depth, freq;
private boolean fullscreen;
private Camera cam;
protected Timer timer;
private Node scene;
private TextureState ts;
private TextureState ts1;
private float xcameralocation=0.0f;
private float ycameralocation=0.0f;
private float zcameralocation=25.0f;
private int count=0;
private int textureWidth;
private int textureHeight;


protected void initGame() {
scene = new Node("Scene graph node");

ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
ts.setTexture(TextureManager.loadTexture(Asteroid3DGame.class.getClassLoader()
.getResource("jmetest/data/images/Monkey.jpg"),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR));

for(int x=0;x<25;x++ )
{
Asteroid asteroid=new Asteroid();
asteroid.setRenderState(ts);
scene.attachChild(asteroid);
}

URL model =
HelloModelLoading.class.getClassLoader().
getResource("images/ship.obj");
FormatConverter converter = new ObjToJme();
ByteArrayOutputStream BO = new ByteArrayOutputStream();
BinaryImporter jbr = new BinaryImporter();
TriMesh ship = null;
ts1 = display.getRenderer().createTextureState();
ts1.setEnabled(true);
ts1.setTexture(TextureManager.loadTexture(Asteroid3DGame.class.getClassLoader()
.getResource("images/lava01.jpg"),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR));
for(int x=0;x<15;x++ )
{
try {
converter.convert(model.openStream(), BO);
ship = (TriMesh) jbr.load(new ByteArrayInputStream(BO.toByteArray()));
} catch (IOException e) {
e.printStackTrace();
System.exit(0);
}

Ship newShip=new Ship(ship,ts1);
scene.attachChild(newShip);
scene.attachChild(ship);
}



scene.updateGeometricState(0.0f, true);
scene.updateRenderState();


}
protected void reinit() {
display.recreateWindow(width, height, depth, freq, fullscreen);
}
protected void cleanup() {
ts.deleteAll();
}

private float getUForPixel(int xPixel) {
return (float) xPixel / textureWidth;
}

private float getVForPixel(int yPixel) {
return 1f - (float) yPixel / textureHeight;
}
protected void initSystem() {

width = properties.getWidth();
height = properties.getHeight();
depth = properties.getDepth();
freq = properties.getFreq();
fullscreen = properties.getFullscreen();
try {
display = DisplaySystem.getDisplaySystem(properties.getRenderer());

display.createWindow(width, height, depth, freq, fullscreen);
//***************
LWJGLRenderer renderer=(LWJGLRenderer)display.getRenderer();//TBD
if(renderer==null) //TBD
{
System.out.println("rednderer is null");//TBD
}
cam = renderer.createCamera(width, height);
} catch (JmeException e) {
e.printStackTrace();
System.exit(1);
}


display.getRenderer().setBackgroundColor(ColorRGBA.black);


cam.setFrustumPerspective(45.0f, (float)width / (float)height, 1, 8000);
Vector3f loc = new Vector3f(xcameralocation,ycameralocation,zcameralocation);
Vector3f left = new Vector3f(-1.0f, 0.0f, 0.0f);
Vector3f up = new Vector3f(0.0f, 1.0f, 0.0f);
Vector3f dir = new Vector3f(0.0f, 0f, -1.0f);
// Move our camera to a correct place and orientation.
cam.setFrame(loc, left, up, dir);

cam.update();

timer = Timer.getTimer();

display.getRenderer().setCamera(cam);

KeyBindingManager.getKeyBindingManager().set("exit",
KeyInput.KEY_ESCAPE);

KeyBindingManager.getKeyBindingManager().set(AsteroidConstants.DOWN,
KeyInput.KEY_DOWN);
KeyBindingManager.getKeyBindingManager().set(AsteroidConstants.LEFT,
KeyInput.KEY_LEFT);
KeyBindingManager.getKeyBindingManager().set(AsteroidConstants.RIGHT,
KeyInput.KEY_RIGHT);
KeyBindingManager.getKeyBindingManager().set(AsteroidConstants.UP,
KeyInput.KEY_UP);


}
private void moveCamera(String direction)
{//TBD increase the camera movement by 5
if(direction.equals(AsteroidConstants.RIGHT))
{
xcameralocation-=7;
Vector3f loc = new Vector3f(xcameralocation,ycameralocation,zcameralocation);
cam.setLocation(loc);
cam.update();

}
if(direction.equals(AsteroidConstants.LEFT))
{
xcameralocation +=7;
Vector3f loc = new Vector3f(xcameralocation,ycameralocation,zcameralocation);
cam.setLocation(loc);
cam.update();
}
if(direction.equals(AsteroidConstants.UP))
{
ycameralocation-=7;
Vector3f loc = new Vector3f(xcameralocation,ycameralocation,zcameralocation);
cam.setLocation(loc);
cam.update();
}
if(direction.equals(AsteroidConstants.DOWN))
{
ycameralocation +=7;
Vector3f loc = new Vector3f(xcameralocation,ycameralocation,zcameralocation);
cam.setLocation(loc);
cam.update();
}
}
protected void update(float interpolation) {
timer.update();
interpolation = timer.getTimePerFrame();
if (KeyBindingManager.getKeyBindingManager().isValidCommand("exit")) {
finished = true;
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand(AsteroidConstants.LEFT)) {
moveCamera(AsteroidConstants.LEFT);
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand(AsteroidConstants.RIGHT)) {
moveCamera(AsteroidConstants.RIGHT);
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand(AsteroidConstants.UP)) {
moveCamera(AsteroidConstants.UP);
}
if (KeyBindingManager.getKeyBindingManager().isValidCommand(AsteroidConstants.DOWN)) {
moveCamera(AsteroidConstants.DOWN);

}

ArrayList<Spatial> childList=scene.getChildren();
if(childList!=null)
{
int size=childList.size();
for(int x=0;x<size;x++ )
{
Spatial spat=childList.get(x);
if(spat instanceof Movable)
{ Movable mov=((Movable) spat);
mov.move();

}

if(spat instanceof Asteroid)
{
Asteroid ast=(Asteroid)(spat);
if(ast.getZLocation()>this.zcameralocation+ 8000)
{
ast.resetLocation();
}
}

if(spat instanceof Ship)
{
Ship ast=(Ship)(spat);
if(ast.getZLocation()>this.zcameralocation+ 8000)
{
ast.resetLocation();
}
}


}
}
count++ ;
if(count%3==0&&count<800)
{
Asteroid asteroid=new Asteroid();
asteroid.setRenderState(ts);
scene.attachChild(asteroid);
scene.updateGeometricState(0.0f, true);
scene.updateRenderState();
}

}

protected void render(float interpolation) {
display.getRenderer().clearBuffers();
display.getRenderer().draw(scene);
}

}




The big change I made since my last post is I created a Ship object to randomize the locations of the TriMesh object in the scene tree. I also added a speed variable to randomize the speed of the objects. I created objects in a loop after importing the TriMesh object. I add the TriMesh object to the scene and the Ship object. The Ship object contains a reference to the TriMesh object so when I move the ship, it will transform the TriMesh object which will change the TriMesh within the scene. When the objects have passed the camera, I reset their location so that they can start over and be placed back in front of the camera. This way we have an endless supply of Asteroids and Ships. So now we have Asteroids and Ships flying towards you at different speeds.
Go To Step 10

Read more...

Friday, January 9, 2009

JME Loading Obj Object Java 3D and Adding Texture #8

Now we want to import a ship into our asteroid field. To create detailed objects you will need to create the object with a modeling tool and import the model into your game. Under your images folder create a file called ship.obj. This is a space ship object that we are going to import into our game. This file doesn't have a material file so we won't add material to it. We are going to import it and then put a texture around it. Copy the following code into the ship.obj and copy the image into your images folder as well.



ship.obj


# Max2Obj Version 4.0 Mar 10th, 2001

v 71.915649 -6.093544 93.30648
v 127.959129 -6.093544 79.358879
v 71.915649 1.472061 93.445831
v 129.802185 1.472061 79.358879
v 72.430237 3.728195 28.531523v 129.824402 3.782799 52.534771
v -123.081139 3.77298 18.238096
v -184.63736 6.825874 0
v 155.736176 19.547897 21.501305
v 72.430237 19.547897 19.339457
v 72.427094 19.548042 9.725137
v 102.145363 19.547897 16.329788
v -101.254112 5.526077 4.701156
v 71.626404 29.516029 7.160007
v 83.141647 29.515892 11.79225
v -63.317017 16.957932 5.383992
v 129.82576 3.782799 21.44491
v 175.763702 9.266739 6.363568
v 182.74411 19.547897 8.170121
v 155.736176 29.547897 21.501305
v 180.464096 29.547897 9.263943
v 206.632538 29.547897 0
v 155.736176 39.547897 19.475733
v 174.494339 39.547897 9.497731
v 205.293213 39.547897 0
v 155.799423 46.017014 13.288635
v 155.845718 49.547897 2.91123
v 203.655914 49.547897 0
v 126.126938 19.573586 19.385944
v 126.126938 29.573586 19.385944
v 153.869522 39.573586 19.475733
v 90.434196 34.285675 9.936822
v 126.377296 34.456261 17.054611
v 104.13562 40.498566 8.845161
v 126.370155 40.556259 14.763659
v 126.225189 49.599747 1.911103
v 136.06221 44.79969 10.957302
v 136.108505 48.330574 2.299404
v 82.20916 28.736427 9.234544
v 102.597588 18.860069 13.979242
v 125.924614 18.884224 16.931358
v 125.919487 28.72921 16.991518
v 153.733429 38.754929 17.084267
v 155.590469 44.854774 10.909411
v 155.636475 48.331192 2.292213
v -205.435883 3.782799 0.139355
v -101.698845 9.746086 0
v 186.931244 12.709236 0
v 120.326454 48.822311 0
v 84.129639 34.180267 0
v 97.184135 40.272812 0
v 71.915649 -3.782806 11.187759
v 129.814056 -3.769974 11.187759
v 160.794678 -8.679623 44.898056
v 160.794678 -0.933075 41.689331
v 160.794678 2.27565 33.942783
v 160.794678 -0.933075 26.196234
v 160.794678 -8.679623 22.987509
v 160.794678 -16.42617 26.196234
v 160.794678 -19.634895 33.942783
v 160.794678 -16.42617 41.689331
v 131.365814 -8.679626 44.898048
v 131.365814 -0.933075 41.689327
v 131.365814 2.27565 33.942776
v 131.365814 -0.933075 26.196228
v 131.365814 -8.679626 22.987503
v 131.365814 -16.426174 26.196228
v 131.365814 -19.634899 33.942776
v 131.365814 -16.42617 41.689327
v 59.598099 -16.312656 26.196226
v 72.193283 -19.634899 33.942772
v 59.598099 -16.312656 41.689323
v 156.48468 -8.679623 46.770058
v 156.48468 0.390633 43.013035
v 156.48468 4.147652 33.942783
v 156.48468 0.390633 24.87253
v 156.48468 -8.679623 21.115509
v 156.48468 -17.749874 24.87253
v 156.48468 -21.506897 33.942783
v 156.48468 -17.749874 43.013035
v 135.675812 0.390625 43.013031
v 135.675812 -8.679623 46.77005
v 135.675812 -17.749874 43.013031
v 135.675812 -21.506897 33.94278
v 135.675812 -17.749878 24.872526
v 135.675812 -8.679623 21.115505
v 135.675812 0.390625 24.872526
v 135.675812 4.147652 33.942776
v 72.366043 -16.325077 78.988808
v 119.893143 -16.408981 26.208025
v 119.89006 -16.408169 67.49865
v 119.893143 -16.408985 41.631622
v 129.823914 -0.933075 41.689327
v 129.813736 2.27565 33.942776
v 129.823914 -0.933075 26.196228
v 125.896179 -8.679626 44.898048
v 125.896179 -8.679626 22.987503
v 71.626404 29.516029 -7.160007
v 83.141647 29.515892 -11.79225
v 73.823875 29.515915 0
v 71.636009 29.515923 0
v 71.915649 -6.093544 -93.30648
v 71.915649 1.472061 -93.445831
v -205.435883 3.782799 -0.139355
v 127.959129 -6.093544 -79.358879
v 129.802185 1.472061 -79.358879
v 129.824402 3.782799 -52.534771
v 72.430237 3.728195 -28.531523
v -63.317017 16.957932 -5.383992
v -123.081139 3.77298 -18.238096
v 155.736176 19.547897 -21.501305
v 175.763702 9.266739 -6.363568
v 207.665771 19.547897 0
v 182.74411 19.547897 -8.170121
v -101.25074 5.52021 0
v 72.430237 19.547897 -19.339457
v -101.25074 5.52021 0
v -101.254112 5.526077 -4.701156
v 72.427094 19.548042 -9.725137
v 102.145363 19.547897 -16.329788
v 129.82576 3.782799 -21.44491
v 180.464096 29.547897 -9.263943
v 155.736176 29.547897 -21.501305
v 174.494339 39.547897 -9.497731
v 155.736176 39.547897 -19.475733
v 155.845718 49.547897 -2.91123
v 155.799423 46.017014 -13.288635
v 126.126938 29.573586 -19.385944
v 126.126938 19.573586 -19.385944
v 153.869522 39.573586 -19.475733
v 125.924614 18.884224 -16.931358
v 125.919487 28.72921 -16.991518
v 82.20916 28.736427 -9.234544
v 102.597588 18.860069 -13.979242
v 126.377296 34.456261 -17.054611
v 90.434196 34.285675 -9.936822
v 126.370155 40.556259 -14.763659
v 104.13562 40.498566 -8.845161
v 155.636475 48.331192 -2.292213
v 136.108505 48.330574 -2.299404
v 136.06221 44.79969 -10.957302
v 155.590469 44.854774 -10.909411
v 126.225189 49.599747 -1.911103
v 153.733429 38.754929 -17.084267
v 175.763702 1.959976 0
v 129.814056 -3.766277 0
v 74.851707 28.672424 0
v -204.80661 3.782722 0
v 156.48468 -8.679623 -46.770058
v 156.48468 0.390633 -43.013035
v 135.675812 0.390625 -43.013031
v 135.675812 -8.679623 -46.77005
v 156.48468 4.147652 -33.942783
v 135.675812 4.147652 -33.942776
v 156.48468 0.390633 -24.87253
v 135.675812 0.390625 -24.872526
v 156.48468 -8.679623 -21.115509
v 135.675812 -8.679623 -21.115505
v 156.48468 -17.749874 -24.87253
v 135.675812 -17.749878 -24.872526
v 156.48468 -21.506897 -33.942783
v 135.675812 -21.506897 -33.94278
v 156.48468 -17.749874 -43.013035
v 135.675812 -17.749874 -43.013031
v 160.794678 -16.42617 -41.689331
v 160.794678 -19.634895 -33.942783
v 160.794678 -16.42617 -26.196234
v 160.794678 -8.679623 -22.987509
v 160.794678 -0.933075 -26.196234
v 160.794678 2.27565 -33.942783
v 160.794678 -0.933075 -41.689331
v 160.794678 -8.679623 -44.898056
v 59.598099 -16.312656 -41.689323
v 59.598099 -16.312656 -26.196226
v 72.193283 -19.634899 -33.942772
v 131.365814 -0.933075 -41.689327
v 131.365814 -8.679626 -44.898048
v 131.365814 -16.42617 -41.689327
v 131.365814 -19.634899 -33.942776
v 131.365814 -16.426174 -26.196228
v 131.365814 -8.679626 -22.987503
v 131.365814 -0.933075 -26.196228
v 131.365814 2.27565 -33.942776
v 71.915649 -3.782806 -11.187759
v 129.814056 -3.769974 -11.187759
v -205.288376 -4.092545 0
v 72.366043 -16.325077 -78.988808
v 119.89006 -16.408169 -67.49865
v 119.893143 -16.408981 -26.208025
v 119.893143 -16.408985 -41.631622
v 125.896179 -8.679626 -22.987503
v 129.823914 -0.933075 -26.196228
v 125.896179 -8.679626 -44.898048
v 129.823914 -0.933075 -41.689327
v 129.813736 2.27565 -33.942776
v -205.022263 3.77935 0
# 196 vertices

vt 0.1347 0.87363 0
vt 0.966487 0.744532 0
vt 0.459203 0.585629 0
vt 0.348025 0.558687 0
vt 0.458215 0.461478 0
vt 0.347983 0.507385 0
vt 0.833717 0.441791 0
vt 0.822456 0.952303 0.398556
vt 0.583767 0.801947 0.577292
vt 0.434854 0.813827 0.577292
vt 0.497875 0.418669 0.584372
vt 0.451711 0.429779 0.591448
vt 0.091379 0.821628 0.380295
vt 0.498625 0.402197 0.717338
vt 0.479456 0.409301 0.717336
vt 0.723809 0.397362 0.540905
vt 0.913692 0.717984 0
vt 0.277882 0.202854 0
vt 0.403516 0.043812 0
vt 0.347591 0.017983 0
vt 0.193561 0.231431 0
vt 0.441555 0.018441 0
vt 0.407669 0.08397 0
vt 0.446358 0.081805 0
vt 0.458015 0.037575 0
vt 0.269166 0.089579 0
vt 0.414678 0.116439 0
vt 0.981638 0.593767 0
vt 0.413723 0.435753 0.591861
vt 0.742089 0.627481 0
vt 0.681983 0.6292 0
vt 0.065568 0.454943 0
vt 0.063133 0.451139 0
vt 0.094684 0.457029 0
vt 0.142694 0.44592 0
vt 0.141183 0.471616 0
vt 0.163082 0.453945 0
vt 0.162064 0.469829 0
vt 0.743781 0.54493 0
vt 0.699696 0.54905 0
vt 0.786797 0.538062 0
vt 0.742968 0.623589 0
vt 0.682707 0.625316 0
vt 0.69142 0.604881 0
vt 0.706896 0.598103 0
vt 0.991888 0.407177 0
vt 0.960106 0.952303 0.439583
vt 0.405825 0.063991 0
vt 0.048192 0.456311 0
vt 0.203699 0.450721 0
vt 0.203664 0.469843 0
vt 0.112216 0.739038 0.249511
vt 0.026115 0.745815 0.249691
vt 0.043525 0.31643 0
vt 0.044178 0.294629 0
vt 0.044178 0.282311 0
vt 0.044178 0.269994 0
vt 0.043525 0.401491 0
vt 0.043525 0.384669 0
vt 0.043525 0.362867 0
vt 0.043525 0.299608 0
vt 0.043525 0.333253 0
vt 0.090724 0.294629 0
vt 0.090724 0.282311 0
vt 0.090724 0.269994 0
vt 0.043525 0.367846 0
vt 0.090071 0.401491 0
vt 0.043525 0.35055 0
vt 0.090071 0.31643 0
vt 0.881523 0.10406 0.073475
vt 0.043525 0.338232 0
vt 0.881523 0.077787 0.073475
vt 0.090071 0.299608 0
vt 0.050995 0.296733 0
vt 0.050995 0.282311 0
vt 0.050995 0.267889 0
vt 0.090071 0.384669 0
vt 0.090071 0.367846 0
vt 0.090071 0.362867 0
vt 0.090071 0.333253 0
vt 0.083907 0.296733 0
vt 0.050342 0.31643 0
vt 0.197248 0.254507 0
vt 0.090071 0.35055 0
vt 0.050342 0.404366 0
vt 0.050342 0.384669 0
vt 0.083907 0.267889 0
vt 0.083907 0.282311 0
vt 0.902877 0.014537 0.073301
vt 0.043293 0.775464 0.072122
vt 0.982358 0.034021 0.072133
vt 0.982363 0.077885 0.072122
vt 0.093163 0.294629 0
vt 0.093179 0.282311 0
vt 0.093163 0.269994 0
vt 0.050342 0.336127 0
vt 0.050342 0.364972 0
vt 0.498475 0.380008 0.717338
vt 0.479141 0.373273 0.717336
vt 0.494883 0.391151 0.717336
vt 0.498542 0.391119 0.717336
vt 0.65693 0.811087 0
vt 0.447994 0.192281 0
vt 0.980679 0.370733 0
vt 0.654111 0.744548 0
vt 0.336816 0.219223 0
vt 0.336774 0.270525 0
vt 0.447006 0.316432 0
vt 0.724336 0.381049 0.540905
vt 0.822508 0.336119 0
vt 0.568253 0.605083 0.577292
vt 0.409358 0.095669 0
vt 0.455723 0.058281 0
vt 0.167913 0.058011 0
vt 0.412602 0.597422 0.577292
vt 0.899966 0.151773 0.380212
vt 0.065678 0.589622 0.380295
vt 0.496396 0.357878 0.574181
vt 0.440217 0.346801 0.571066
vt 0.706906 0.718001 0
vt 0.168268 0.0785 0
vt 0.169225 0.099059 0
vt 0.230106 0.086655 0
vt 0.966487 0.724195 0
vt 0.257331 0.127481 0
vt 0.21161 0.028663 0
vt 0.683005 0.636252 0
vt 0.39532 0.344823 0.571404
vt 0.743134 0.635751 0
vt 0.69856 0.553211 0
vt 0.681983 0.632395 0
vt 0.745043 0.548609 0
vt 0.786883 0.54196 0
vt 0.129025 0.54787 0
vt 0.128721 0.47431 0
vt 0.052249 0.47431 0
vt 0.079829 0.47431 0
vt 0.681983 0.618459 0
vt 0.048192 0.49231 0
vt 0.065568 0.493679 0
vt 0.685533 0.620193 0
vt 0.14132 0.503045 0
vt 0.742267 0.631896 0
vt 0.199916 0.242622 0
vt 0.024599 0.726561 0.249743
vt 0.714826 0.577878 0
vt 0.752404 0.519511 0
vt 0.0476 0.187397 0
vt 0.047601 0.206731 0
vt 0.080513 0.206731 0
vt 0.706099 0.612167 0
vt 0.047601 0.223699 0
vt 0.080513 0.223699 0
vt 0.047601 0.239939 0
vt 0.080513 0.239939 0
vt 0.046947 0.103099 0
vt 0.079859 0.103099 0
vt 0.046947 0.120613 0
vt 0.079859 0.120613 0
vt 0.046947 0.137765 0
vt 0.079859 0.137765 0
vt 0.27294 0.04978 0
vt 0.080513 0.187397 0
vt 0.047601 0.166609 0
vt 0.047601 0.152187 0
vt 0.508529 0.052237 0
vt 0.284648 0.240618 0
vt 0.040784 0.237835 0
vt 0.040784 0.223699 0
vt 0.040784 0.208835 0
vt 0.080513 0.166609 0
vt 0.881523 0.219177 0.073475
vt 0.881523 0.192904 0.073475
vt 0.080513 0.152187 0
vt 0.087329 0.208835 0
vt 0.040784 0.169484 0
vt 0.040784 0.203856 0
vt 0.234948 0.024339 0
vt 0.04013 0.13489 0
vt 0.04013 0.120613 0
vt 0.087329 0.237835 0
vt 0.087329 0.223699 0
vt 0.109185 0.700531 0.249511
vt 0.023084 0.707307 0.249691
vt 0.438515 0.148482 0.24516
vt 0.902877 0.282428 0.073301
vt 0.982358 0.262943 0.072133
vt 0.035413 0.675335 0.072122
vt 0.982363 0.219079 0.072122
vt 0.04013 0.105973 0
vt 0.089768 0.237835 0
vt 0.040784 0.187397 0
vt 0.089768 0.208835 0
vt 0.089784 0.223699 0
vt 0.709995 0.519303 0
vt 0.620759 0.988106 0
vt 0.852501 0.717984 0
vt 0.436964 0.777302 0.355036
vt 0.544785 0.727172 0.355803
vt 0.047493 0.791872 0.355665
vt 0.787937 0.952063 0.355803
vt 0.008638 0.893197 0
vt 0.787937 0.952544 0.355803
vt 0.654111 0.724212 0
vt 0.519847 0.672472 0.355803
vt 0.411547 0.639223 0.355036
vt 0.024344 0.630983 0.355665
vt 0.339175 0.340503 0.571066
vt 0.494897 0.338594 0.571066
vt 0.789429 0.364728 0.383408
vt 0.76799 0.648352 0
vt 0.924618 0.983788 0.355665
vt 0.368997 0.4481 0.591448
vt 0.49674 0.435271 0.591448
vt 0.789598 0.409011 0.373216
vt 0.852607 0.648335 0
vt 0.924618 0.920819 0.355665
vt 0.132957 0.768385 0.073475
vt 0.090071 0.338232 0
vt 0.141815 0.954104 0
vt 0.832313 0.738286 0
vt 0.268172 0.106897 0
vt 0.168175 0.037594 0
vt 0.12508 0.6683 0.073475
vt 0.522933 0.687341 0.24516
vt 0.762774 0.829823 0
vt 0.726489 0.612167 0
vt 0.087329 0.203856 0
vt 0.861875 0.77226 0
vt 0.083254 0.364972 0
vt 0.281096 0.275219 0
vt 0.768097 0.718001 0
vt 0.086676 0.13489 0
vt 0.203581 0.362867 0
vt 0.040784 0.164504 0
vt 0.375868 0.150002 0
vt 0.620759 0.971566 0
vt 0.697494 0.583385 0
vt 0.900547 0.142383 0.380295
vt 0.709995 0.519719 0
vt 0.713632 0.555889 0
vt 0.712665 0.576242 0
vt 0.928325 0.493848 0
vt 0.014389 0.966514 0
vt 0.899398 0.161164 0.380295
vt 0.447501 0.378468 0
vt 0.824918 0.157978 0.540905
vt 0.370316 0.385714 0
vt 0.826233 0.136468 0.540905
vt 0.711278 0.519511 0
vt 0.710838 0.519511 0
vt 0.945005 0.11796 0.355665
vt 0.940549 0.190823 0.355665
vt 0.986957 0.486241 0
vt 0.743286 0.988106 0
vt 0.747315 0.971566 0
vt 0.928458 0.484151 0
vt 0.869923 0.484638 0
vt 0.681983 0.567153 0
vt 0.740733 0.592477 0
vt 0.783177 0.594508 0
vt 0.783722 0.591259 0
vt 0.704693 0.615832 0
vt 0.724767 0.615742 0
vt 0.38678 0.385715 0
vt 0.40501 0.378468 0
vt 0.032346 0.8511 0
vt 0.019288 0.954104 0
vt 0.014711 0.983732 0
vt 0.141815 0.937563 0
vt 0.015259 0.937563 0
vt 0.375868 0.156591 0
vt 0.748185 0.932511 0
vt 0.139209 0.910022 0
vt 0.747862 0.949729 0
vt 0.290141 0.158197 0
vt 0.654397 0.841835 0
vt 0.375831 0.161094 0
vt 0.770427 0.885696 0
vt 0.033308 0.923094 0
vt 0.290141 0.148396 0
vt 0.744613 0.857373 0
vt 0.375831 0.145499 0
vt 0.134102 0.527381 0
vt 0.04315 0.504779 0
vt 0.080472 0.535866 0
vt 0.139071 0.515172 0
vt 0.063133 0.497482 0
vt 0.276724 0.549164 0
vt 0.094684 0.491592 0
vt 0.161417 0.495707 0
vt 0.200924 0.495759 0
vt 0.197424 0.51587 0
vt 0.140419 0.433264 0
vt 0.301724 0.538369 0
vt 0.311934 0.51297 0
vt 0.301372 0.487846 0
vt 0.04315 0.443842 0
vt 0.080472 0.412755 0
vt 0.13143 0.401439 0
vt 0.137194 0.421584 0
vt 0.199221 0.43357 0
vt 0.276225 0.477714 0
vt 0.251225 0.488509 0
vt 0.202792 0.479835 0
vt 0.1618 0.480114 0
vt 0.241016 0.513908 0
vt 0.251578 0.539032 0
vt 0.141183 0.478035 0
vt 0.032648 0.47431 0
vt 0.927549 0.591355 0
vt 0.981638 0.588944 0
vt 0.696836 0.580099 0
vt 0.742433 0.589313 0
vt 0.170782 0.242665 0
vt 0.218453 0.043442 0
vt 0.508135 0.072726 0
vt 0.328912 0.024055 0
vt 0.220706 0.064152 0
vt 0.270593 0.069954 0
vt 0.943144 0.772258 0
vt 0.892232 0.77226 0
vt 0.892346 0.73066 0
vt 0.507141 0.093283 0
vt 0.343773 0.050701 0
vt 0.877099 0.722035 0
vt 0.330322 0.076954 0
vt 0.332668 0.05678 0
vt 0.273649 0.090067 0
vt 0.346082 0.07088 0
vt 0.404374 0.084151 0
vt 0.464885 0.022808 0
vt 0.508304 0.03182 0
vt 0.861852 0.73066 0
vt 0.898661 0.751483 0
vt 0.855537 0.751483 0
vt 0.810299 0.738284 0
vt 0.37146 0.399967 0
vt 0.413952 0.399967 0
vt 0.448646 0.364216 0
vt 0.432182 0.364216 0
vt 0.684643 0.567421 0
vt 0.694944 0.60733 0
vt 0.707796 0.600624 0
vt 0.788285 0.738303 0
vt 0.18366 0.35055 0
vt 0.203581 0.338232 0
vt 0.677454 0.772275 0
vt 0.050342 0.35055 0
vt 0.758722 0.772277 0
vt 0.083254 0.336127 0
vt 0.083254 0.35055 0
vt 0.728366 0.772277 0
vt 0.108216 0.338324 0
vt 0.25575 0.432647 0
vt 0.280741 0.442995 0
vt 0.30479 0.431887 0
vt 0.31381 0.405829 0
vt 0.302517 0.380085 0
vt 0.277526 0.369737 0
vt 0.253477 0.380846 0
vt 0.244457 0.406904 0
vt 0.726489 0.620419 0
vt 0.706099 0.620419 0
vt 0.704693 0.616731 0
vt 0.724767 0.616819 0
vt 0.765061 0.7515 0
vt 0.758746 0.730677 0
vt 0.721937 0.7515 0
vt 0.728252 0.730677 0
vt 0.715576 0.598222 0
vt 0.731041 0.605425 0
vt 0.040784 0.152187 0
vt 0.040784 0.139869 0
vt 0.200839 0.164504 0
vt 0.200839 0.140233 0
vt 0.180919 0.152551 0
vt 0.087329 0.164504 0
vt 0.087329 0.152551 0
vt 0.087329 0.140233 0
vt 0.105475 0.164413 0
vt 0.743499 0.722052 0
vt 0.740051 0.619256 0
vt 0.71463 0.600718 0
vt 0.727471 0.607777 0
vt 0.736471 0.620893 0
vt 0.083254 0.384669 0
vt 0.083254 0.404366 0
vt 0.108216 0.367884 0
vt 0.092509 0.401491 0
vt 0.098722 0.384669 0
vt 0.083254 0.31643 0
vt 0.108216 0.333215 0
vt 0.092509 0.299608 0
vt 0.098722 0.31643 0
vt 0.087329 0.187397 0
vt 0.087329 0.169484 0
vt 0.105475 0.169521 0
vt 0.09598 0.187397 0
vt 0.089768 0.203856 0
vt 0.086676 0.120613 0
vt 0.086676 0.105973 0
vt 0.104821 0.134853 0
vt 0.095327 0.120613 0
vt 0.089114 0.105973 0
# 405 texture vertices

vn -0.032117 -0.014745 1.364888
vn 0.323423 -0.078789 2.423999
vn -0.102044 -0.041563 4.197857
vn 0.238748 -0.054391 1.793193
vn -0.007756 0.998849 0.064638
vn 0.010775 1.857956 0.224189
vn -0.046605 3.247817 0.410729
vn -0.309122 2.337778 2.675988
vn -0.093255 0.589572 0.413414
vn -0.02733 0.611945 1.964421
vn -0.424119 0.442128 4.329516
vn -0.076599 0.010861 0.642889
vn -0.005112 0.007691 0.289621
vn 0.000033 1.855408 -0.000052
vn 0.000007 0.460902 -0.00001
vn -0.07106 0.11764 4.01364
vn 0.418065 -1.452303 1.390242
vn 0.374273 -0.337449 0.884628
vn 0.72184 -1.053688 2.335124
vn 0.150875 0.073213 1.346399
vn 0.614785 0.003143 2.32197
vn 0.758246 0.071575 4.121275
vn 0.204587 0.400897 1.219589
vn 0.70619 0.360623 2.618813
vn 0.725799 0.138087 4.130212
vn 2.618461 0.111852 0.268069
vn 0.518213 0.81628 0.925566
vn 0.324093 0.233622 2.314889
vn -0.082102 0 2.143553
vn -0.100095 0.047891 2.614408
vn -0.05948 1.164224 5.264995
vn -0.328913 0.563856 1.034617
vn -0.075573 0.126649 1.350806
vn -0.259988 0.733364 0.857902
vn -0.10376 0.49828 1.175609
vn -0.050755 0.937757 0.46922
vn -0.012889 0.733084 0.928725
vn 0.058049 0.965028 0.349138
vn -0.140933 0.093911 1.405625
vn -0.331284 0.187636 3.637495
vn -0.14501 -0.007078 2.137387
vn -0.371712 0.022293 5.933917
vn -0.014198 1.076394 2.458033
vn -0.000757 2.173762 2.499947
vn 0.00016 1.369974 1.030898
vn -0.370311 -0.026402 2.051937
vn -0.01922 0.545879 0.291437
vn 1.132683 -1.771071 3.751712
vn -0.263693 0.964607 0
vn -0.509745 0.860325 0
vn -0.388596 0.921408 0
vn 0.006282 -0.662533 -1.022949
vn 0.000151 -0.680132 -1.067307
vn 0.337543 0 0
vn 2.38009 0 0
vn 0.423959 0 0
vn 2.380091 0 0
vn 0.337543 0 0
vn 2.380091 0 0
vn 0.423959 0 0
vn 2.38009 0 0
vn -0.965963 -0.000001 4.148281
vn -1.090204 1.80867 3.247495
vn -0.625274 1.439599 -1.11225
vn -1.090204 1.808669 -3.247496
vn -0.965962 0 -4.148281
vn -1.090204 -1.808669 -3.247496
vn -0.625273 -1.439598 1.112251
vn -1.090205 -1.808669 3.247496
vn -0.295885 -1.121748 0
vn -0.039482 -0.999219 0.001821
vn -0.295884 -1.121748 0
vn -0.000001 0 4.105916
vn -0.000001 1.823087 3.109263
vn 0 1.36719 1.056305
vn 0 1.823087 -3.109263
vn 0.000001 0 -4.105917
vn 0 -1.823087 -3.109264
vn 0 -1.367189 -1.056306
vn 0 -1.823087 3.109264
vn -0.000001 1.823087 3.109265
vn -0.000001 0 4.105917
vn 0 -1.823087 3.109264
vn 0 -1.36719 -1.056305
vn 0.000001 -1.823087 -3.109263
vn 0 0 -4.105916
vn 0 1.823087 -3.109265
vn -0.000001 1.367189 1.056306
vn -0.287723 -1.173617 1.54746
vn -0.000059 -1.382139 -2.16677
vn 0.247514 -1.382259 1.928162
vn -0.002658 -1.569931 0.000269
vn 0 1.955557 3.70072
vn 0 1.36583 1.055255
vn 0 1.955557 -3.70072
vn -0.004881 -0.31953 4.348463
vn -0.001426 -0.317466 -4.350155
vn 0.000033 1.855408 0.000052
vn 0.000007 0.460902 0.00001
vn 0.000008 2.394247 -0.000004
vn 0.000012 1 0
vn -0.032117 -0.014745 -1.364888
vn -0.102044 -0.041563 -4.197857
vn -0.370311 -0.026402 -2.051937
vn 0.323423 -0.078789 -2.423999
vn 0.238748 -0.054391 -1.793193
vn 0.010775 1.857956 -0.224189
vn -0.007756 0.998849 -0.064638
vn -0.07106 0.11764 -4.01364
vn -0.046605 3.247817 -0.410729
vn -0.093255 0.589572 -0.413414
vn 0.317328 -0.473843 -1.121884
vn 0.418208 -0.192042 2.379452
vn 0.318846 -0.231145 -1.255375
vn 1 0 0
vn -0.02733 0.611945 -1.964421
vn 0.802019 0.085045 1.805817
vn -0.005112 0.007691 -0.289621
vn -0.424119 0.442128 -4.329517
vn -0.076599 0.010861 -0.642889
vn 0.418065 -1.452303 -1.390242
vn 0.283099 0.060701 -1.307243
vn 0.150875 0.073213 -1.346399
vn 0.206762 0.348801 -1.24843
vn 0.204587 0.400897 -1.219589
vn 0.539839 1.090535 -1.588025
vn 2.618461 0.111852 -0.268069
vn -0.100095 0.047891 -2.614408
vn -0.082102 0 -2.143553
vn -0.05948 1.164224 -5.264995
vn -0.14501 -0.007078 -2.137387
vn -0.371712 0.022293 -5.933917
vn -0.140933 0.093911 -1.405625
vn -0.331284 0.187636 -3.637495
vn -0.075573 0.126649 -1.350806
vn -0.328913 0.563856 -1.034617
vn -0.10376 0.49828 -1.175609
vn -0.259988 0.733364 -0.857902
vn 0.00016 1.369974 -1.030898
vn 0.058049 0.965028 -0.349138
vn -0.012889 0.733084 -0.928725
vn -0.000757 2.173762 -2.499947
vn -0.050755 0.937757 -0.46922
vn -0.014198 1.076394 -2.458033
vn 0.111998 -0.898717 1.924793
vn 0.294492 -1.299155 0.996616
vn -0.394498 0.66453 0.577674
vn -0.139981 0.990154 0
vn -0.000001 0 -4.105916
vn -0.000001 1.823087 -3.109263
vn -0.000001 1.823087 -3.109265
vn -0.000001 0 -4.105916
vn 0 1.36719 -1.056305
vn -0.000001 1.367189 -1.056306
vn 0 1.823087 3.109262
vn 0 1.823087 3.109265
vn 0.000001 0 4.105917
vn 0 0 4.105916
vn 0 -1.823087 3.109264
vn 0.000001 -1.823087 3.109263
vn 0 -1.367189 1.056306
vn 0 -1.36719 1.056305
vn 0 -1.823087 -3.109264
vn 0 -1.823087 -3.109264
vn 2.38009 0 0
vn 0.423959 0 0
vn 2.380091 0 0
vn 0.337543 0 0
vn 2.380091 0 0
vn 0.423959 0 0
vn 2.38009 0 0
vn 0.337543 0 0
vn -0.362992 -2.576386 0
vn -0.295885 -1.121748 0
vn -0.039482 -0.999219 -0.001821
vn -1.090204 1.80867 -3.247495
vn -0.965963 -0.000001 -4.148281
vn -1.090205 -1.808669 -3.247496
vn -0.625273 -1.439598 -1.112251
vn -1.090204 -1.808669 3.247496
vn -0.965962 0 4.148281
vn -1.090204 1.808669 3.247496
vn -0.625274 1.439599 1.11225
vn 0.006282 -0.662533 1.022949
vn 0.000151 -0.680132 1.067307
vn -0.383098 -0.069426 2.111949
vn -0.287723 -1.173618 -1.547459
vn 0.247514 -1.382259 -1.928162
vn -0.000059 -1.382139 2.16677
vn -0.005393 -3.852763 -1.779155
vn -0.001426 -0.317466 4.350155
vn 0 1.955557 3.70072
vn -0.004881 -0.31953 -4.348463
vn 0 1.955557 -3.70072
vn 0 1.36583 -1.055255
vn -0.370193 0.012514 -2.050054
# 196 normals

g fighter01
s 1
f 182/391/182 97/306/97 96/305/96
f 96/305/96 183/392/183 182/391/182
f 11/131/11 196/186/196 194/136/194
f 194/136/194 151/133/151 11/131/11
f 196/186/196 195/138/195 193/135/193
f 193/135/193 194/136/194 196/186/196
s 16
f 194/403/194 193/402/193 191/400/191
f 191/400/191 192/401/192 194/403/194
f 190/399/190 151/360/151 194/403/194
f 194/403/194 192/401/192 190/399/190
s 2
f 189/398/189 151/205/151 190/189/190
f 190/189/190 150/359/150 189/398/189
s 0
f 192/208/192 191/207/191 188/397/188
s 2
f 149/74/149 84/73/84 178/381/178
f 178/381/178 179/384/179 149/74/149
s 0
f 192/208/192 188/397/188 187/396/187
s 2
f 186/160/186 185/140/185 182/65/182
f 182/65/182 183/66/183 186/160/186
f 181/390/181 184/191/184 186/395/186
f 186/395/186 183/392/183 181/390/181
s 1
f 188/387/188 180/386/180 179/384/179
f 179/384/179 178/381/178 188/387/188
f 188/387/188 178/381/178 176/293/176
f 176/293/176 177/358/177 188/387/188
s 2
f 178/381/178 84/73/84 175/240/175
f 175/240/175 176/293/176 178/381/178
s 1
f 177/358/177 176/293/176 173/382/173
f 173/382/173 174/383/174 177/358/177
s 2
f 176/293/176 175/240/175 172/89/172
f 172/89/172 173/382/173 176/293/176
s 1
f 174/383/174 173/382/173 170/379/170
f 170/379/170 171/294/171 174/383/174
s 2
f 173/382/173 172/89/172 169/82/169
f 169/82/169 170/379/170 173/382/173
s 1
f 188/387/188 177/358/177 167/76/167
f 167/76/167 168/81/168 188/387/188
f 177/358/177 174/383/174 166/75/166
f 166/75/166 167/76/167 177/358/177
f 171/294/171 166/75/166 174/383/174
f 155/105/155 158/108/158 157/107/157
f 157/107/157 156/106/156 155/105/155
f 158/108/158 155/105/155 164/112/164
f 164/112/164 165/373/165 158/108/158
f 165/373/165 164/112/164 162/371/162
f 162/371/162 163/372/163 165/373/165
f 159/368/159 160/369/160 153/356/153
f 153/356/153 152/355/152 159/368/159
f 162/371/162 161/370/161 163/372/163
f 160/369/160 159/368/159 161/370/161
f 161/370/161 162/371/162 160/369/160
f 155/105/155 154/104/154 164/112/164
f 154/104/154 153/356/153 160/369/160
f 154/104/154 160/369/160 162/371/162
f 164/112/164 154/104/154 162/371/162
s 8
f 182/366/182 185/367/185 157/274/157
f 157/274/157 158/276/158 182/366/182
f 185/367/185 168/365/168 156/273/156
f 156/273/156 157/274/157 185/367/185
s 4
f 168/255/168 167/179/167 155/142/155
f 155/142/155 156/143/156 168/255/168
s 2
f 167/376/167 166/375/166 154/363/154
f 154/363/154 155/364/155 167/376/167
s 4
f 166/268/166 171/362/171 153/63/153
f 153/63/153 154/265/154 166/268/166
f 171/362/171 170/361/170 152/62/152
f 152/62/152 153/63/153 171/362/171
s 1
f 179/385/179 180/388/180 51/239/51
f 51/239/51 52/262/52 179/385/179
s 2
f 149/91/149 179/385/179 52/262/52
s 1
f 158/357/158 165/374/165 147/270/147
f 147/270/147 50/96/50 158/357/158
f 165/374/165 163/372/163 146/269/146
f 146/269/146 147/270/147 165/374/165
f 163/372/163 161/370/161 148/271/148
f 148/271/148 146/269/146 163/372/163
s 8
f 97/147/97 182/366/182 158/276/158
f 158/276/158 50/64/50 97/147/97
s 4
f 49/156/49 151/211/151 189/259/189
s 16
f 185/394/185 186/395/186 187/192/187
f 168/377/168 185/394/185 187/192/187
f 188/193/188 168/377/168 187/192/187
s 8
f 124/324/124 123/332/123 116/325/116
f 116/325/116 115/14/115 124/324/124
f 123/332/123 122/331/122 109/318/109
f 109/318/109 116/325/116 123/332/123
s 16
f 122/331/122 121/330/121 110/319/110
f 110/319/110 109/318/109 122/331/122
f 121/321/121 120/320/120 111/19/111
f 111/19/111 110/18/110 121/321/121
f 120/320/120 119/309/119 112/176/112
f 112/176/112 111/19/111 120/320/120
f 119/309/119 118/57/118 113/54/113
f 113/54/113 112/176/112 119/309/119
s 8
f 118/57/118 117/310/117 114/55/114
f 114/55/114 113/54/113 118/57/118
f 117/310/117 124/324/124 115/14/115
f 115/14/115 114/55/114 117/310/117
s 0
f 137/99/137 138/102/138 139/103/139
f 139/103/139 140/109/140 141/110/141
f 141/110/141 142/111/142 143/117/143
f 139/103/139 141/110/141 143/117/143
f 137/99/137 139/103/139 143/117/143
f 136/98/136 137/99/137 143/117/143
s 4
f 125/59/125 127/172/127 126/60/126
s 2
f 143/352/143 142/345/142 123/332/123
f 123/332/123 124/324/124 143/352/143
f 142/351/142 141/350/141 122/331/122
f 122/331/122 123/332/123 142/351/142
s 4
f 141/350/141 140/349/140 121/330/121
f 121/330/121 122/331/122 141/350/141
f 140/348/140 139/347/139 120/320/120
f 120/320/120 121/321/121 140/348/140
f 139/347/139 138/340/138 119/309/119
f 119/309/119 120/320/120 139/347/139
f 138/346/138 137/338/137 118/57/118
f 118/57/118 119/309/119 138/346/138
s 2
f 137/338/137 136/335/136 117/310/117
f 117/310/117 118/57/118 137/338/137
f 136/344/136 143/352/143 124/324/124
f 124/324/124 117/310/117 136/344/136
s 1
f 134/333/134 135/337/135 115/14/115
f 115/14/115 116/325/116 134/333/134
f 135/337/135 128/326/128 114/55/114
f 114/55/114 115/14/115 135/337/135
f 128/187/128 129/322/129 113/54/113
f 113/54/113 114/55/114 128/187/128
s 2
f 129/322/129 130/327/130 112/176/112
f 112/176/112 113/54/113 129/322/129
f 130/328/130 131/329/131 111/19/111
f 111/19/111 112/176/112 130/328/130
f 131/329/131 132/339/132 110/18/110
f 110/18/110 111/19/111 131/329/131
f 132/341/132 133/342/133 109/318/109
f 109/318/109 110/319/110 132/341/132
s 1
f 133/342/133 134/343/134 116/325/116
f 116/325/116 109/318/109 133/342/133
s 0
f 196/405/196 11/127/11 108/132/108
f 195/204/195 196/405/196 108/132/108
f 108/132/108 106/126/106 195/204/195
s 4
f 191/389/191 180/209/180 188/190/188
s 2
f 145/354/145 144/353/144 107/316/107
f 107/316/107 127/188/127 145/354/145
s 1
f 125/334/125 11/221/11 127/336/127
s 2
f 11/181/11 145/354/145 127/188/127
s 1
f 105/314/105 106/315/106 108/317/108
f 108/317/108 125/334/125 105/314/105
f 108/317/108 11/221/11 125/334/125
s 4
f 129/322/129 128/187/128 105/52/105
f 129/322/129 105/52/105 125/59/125
f 129/322/129 125/59/125 126/60/126
f 126/60/126 127/172/127 130/327/130
f 130/327/130 129/322/129 126/60/126
s 16
f 100/15/100 131/329/131 130/328/130
f 130/328/130 107/17/107 100/15/100
f 102/16/102 132/339/132 131/329/131
f 131/329/131 100/15/100 102/16/102
s 4
f 128/326/128 135/337/135 101/11/101
f 101/11/101 105/13/105 128/326/128
f 135/337/135 134/333/134 104/12/104
f 104/12/104 101/11/101 135/337/135
f 133/342/133 103/312/103 104/313/104
f 104/313/104 134/343/134 133/342/133
s 16
f 102/311/102 103/312/103 133/342/133
f 133/342/133 132/341/132 102/311/102
s 8
f 100/70/100 107/177/107 144/185/144
f 144/185/144 102/72/102 100/70/100
f 195/404/195 106/85/106 105/84/105
f 195/404/195 105/84/105 101/71/101
f 104/83/104 195/404/195 101/71/101
f 180/209/180 191/389/191 103/80/103
f 191/389/191 193/282/193 195/404/195
f 191/389/191 195/404/195 104/83/104
f 103/80/103 191/389/191 104/83/104
f 180/209/180 103/80/103 102/72/102
f 180/209/180 102/72/102 144/185/144
f 51/69/51 180/209/180 144/185/144
f 11/130/11 151/134/151 1/128/1
s 4
f 1/155/1 151/211/151 49/156/49
s 1
f 98/307/98 99/308/99 96/305/96
f 96/305/96 97/306/97 98/307/98
s 2
f 11/137/11 93/162/93 94/169/94
f 94/169/94 95/210/95 11/137/11
f 95/210/95 94/169/94 91/150/91
f 91/150/91 92/151/92 95/210/95
s 64
f 94/303/94 89/298/89 90/299/90
f 90/299/90 91/300/91 94/303/94
f 87/296/87 89/298/89 94/303/94
f 94/303/94 93/302/93 87/296/87
s 128
f 189/398/189 150/359/150 87/194/87
f 87/194/87 93/203/93 189/398/189
s 0
f 89/200/89 86/295/86 90/201/90
s 16
f 149/280/149 85/228/85 83/90/83
f 83/90/83 84/183/84 149/280/149
s 0
f 89/200/89 81/291/81 86/295/86
s 2
f 78/68/78 99/158/99 98/141/98
f 98/141/98 77/67/77 78/68/78
f 88/297/88 99/308/99 78/288/78
f 78/288/78 79/196/79 88/297/88
s 16
f 86/244/86 83/90/83 85/228/85
f 85/228/85 76/88/76 86/244/86
f 86/244/86 74/86/74 75/87/75
f 75/87/75 83/90/83 86/244/86
f 83/90/83 75/87/75 175/292/175
f 175/292/175 84/183/84 83/90/83
f 74/86/74 72/380/72 73/283/73
f 73/283/73 75/87/75 74/86/74
f 75/87/75 73/283/73 172/285/172
f 172/285/172 175/292/175 75/87/75
f 72/380/72 70/184/70 71/281/71
f 71/281/71 73/283/73 72/380/72
f 73/283/73 71/281/71 169/284/169
f 169/284/169 172/285/172 73/283/73
f 86/244/86 68/78/68 69/79/69
f 69/79/69 74/86/74 86/244/86
f 74/86/74 69/79/69 67/77/67
f 67/77/67 72/380/72 74/86/74
f 70/184/70 72/380/72 67/77/67
s 1
f 65/122/65 66/272/66 63/120/63
f 63/120/63 64/121/64 65/122/65
f 64/121/64 61/118/61 62/119/62
f 62/119/62 65/122/65 64/121/64
f 61/118/61 59/116/59 60/264/60
f 60/264/60 62/119/62 61/118/61
f 57/100/57 58/101/58 55/114/55
f 55/114/55 56/115/56 57/100/57
f 60/264/60 59/116/59 54/97/54
f 56/115/56 60/264/60 54/97/54
f 54/97/54 57/100/57 56/115/56
f 65/122/65 62/119/62 53/113/53
f 56/115/56 55/114/55 53/113/53
f 60/264/60 56/115/56 53/113/53
f 62/119/62 60/264/60 53/113/53
s 32
f 98/168/98 64/93/64 63/92/63
f 63/92/63 77/146/77 98/168/98
f 77/146/77 63/92/63 66/144/66
f 66/144/66 68/145/68 77/146/77
s 4
f 68/42/68 66/41/66 65/40/65
f 65/40/65 69/43/69 68/42/68
s 2
f 69/279/69 65/275/65 53/263/53
f 53/263/53 67/277/67 69/279/69
s 4
f 67/23/67 53/20/53 55/21/55
f 55/21/55 70/34/70 67/23/67
f 70/34/70 55/21/55 58/22/58
f 58/22/58 71/35/71 70/34/70
s 16
f 85/323/85 52/262/52 51/239/51
f 51/239/51 76/175/76 85/323/85
f 149/91/149 52/262/52 85/323/85
s 1
f 64/267/64 50/96/50 147/270/147
f 147/270/147 61/266/61 64/267/64
f 61/266/61 147/270/147 146/269/146
f 146/269/146 59/116/59 61/266/61
f 59/116/59 146/269/146 148/271/148
f 148/271/148 54/97/54 59/116/59
s 32
f 97/260/97 50/164/50 64/165/64
f 64/93/64 98/168/98 97/147/97
s 4
f 49/156/49 189/259/189 93/166/93
s 64
f 81/197/81 78/288/78 77/287/77
f 81/197/81 77/287/77 68/278/68
f 86/198/86 81/197/81 68/278/68
s 1
f 48/258/48 45/243/45 46/256/46
f 46/256/46 47/257/47 48/258/48
f 47/257/47 46/256/46 43/253/43
f 43/253/43 44/254/44 47/257/47
s 8
f 44/254/44 43/253/43 41/251/41
f 41/251/41 42/252/42 44/254/44
f 42/250/42 41/249/41 39/247/39
f 39/247/39 40/248/40 42/250/42
f 40/248/40 39/247/39 37/245/37
f 37/245/37 38/246/38 40/248/40
f 38/246/38 37/245/37 35/232/35
f 35/232/35 36/241/36 38/246/38
s 1
f 36/241/36 35/232/35 33/235/33
f 33/235/33 34/242/34 36/241/36
f 34/242/34 33/235/33 45/243/45
f 45/243/45 48/258/48 34/242/34
s 0
f 25/44/25 26/45/26 27/46/27
f 27/46/27 28/47/28 29/48/29
f 25/44/25 27/46/27 29/48/29
f 29/48/29 30/49/30 31/50/31
f 25/44/25 29/48/29 31/50/31
f 32/51/32 25/44/25 31/50/31
s 1
f 24/31/24 22/29/22 23/30/23
s 2
f 25/214/25 48/258/48 47/257/47
f 47/257/47 26/229/26 25/214/25
f 26/236/26 47/257/47 44/254/44
f 44/254/44 27/237/27 26/236/26
s 4
f 27/237/27 44/254/44 42/252/42
f 42/252/42 28/238/28 27/237/27
f 28/216/28 42/250/42 40/248/40
f 40/248/40 29/226/29 28/216/28
f 29/226/29 40/248/40 38/246/38
f 38/246/38 30/227/30 29/226/29
f 30/32/30 38/246/38 36/241/36
f 36/241/36 31/33/31 30/32/30
s 2
f 31/33/31 36/241/36 34/242/34
f 34/242/34 32/171/32 31/33/31
f 32/230/32 34/242/34 48/258/48
f 48/258/48 25/214/25 32/230/32
s 4
f 21/178/21 46/256/46 45/243/45
f 45/243/45 20/10/20 21/178/21
f 20/10/20 45/243/45 33/235/33
f 33/235/33 19/9/19 20/10/20
f 19/28/19 33/235/33 35/232/35
f 35/232/35 18/27/18 19/28/19
s 16
f 18/27/18 35/232/35 37/245/37
f 37/245/37 17/26/17 18/27/18
f 17/173/17 37/245/37 39/247/39
f 39/247/39 16/5/16 17/173/17
f 16/5/16 39/247/39 41/249/41
f 41/249/41 15/4/15 16/5/16
f 15/225/15 41/251/41 43/253/43
f 43/253/43 14/224/14 15/225/15
s 4
f 14/224/14 43/253/43 46/256/46
f 46/256/46 21/231/21 14/224/14
s 0
f 95/304/95 10/129/10 11/139/11
f 92/180/92 9/124/9 10/129/10
f 10/129/10 95/304/95 92/180/92
s 1
f 90/286/90 86/195/86 76/174/76
s 4
f 13/223/13 23/182/23 8/218/8
f 8/218/8 12/222/12 13/223/13
s 1
f 24/234/24 23/233/23 11/221/11
s 4
f 11/181/11 23/182/23 13/223/13
s 1
f 7/217/7 24/234/24 10/220/10
f 10/220/10 9/219/9 7/217/7
f 10/220/10 24/234/24 11/221/11
f 18/27/18 22/29/22 24/31/24
f 18/27/18 24/31/24 7/25/7
f 18/27/18 7/25/7 19/28/19
f 22/29/22 18/27/18 17/26/17
f 17/26/17 23/30/23 22/29/22
s 2
f 6/2/6 8/3/8 17/173/17
f 17/173/17 16/5/16 6/2/6
f 5/1/5 6/2/6 16/5/16
f 16/5/16 15/4/15 5/1/5
s 1
f 19/9/19 7/8/7 4/7/4
f 4/7/4 20/10/20 19/9/19
f 20/10/20 4/7/4 3/6/3
f 3/6/3 21/178/21 20/10/20
f 14/224/14 21/231/21 3/213/3
f 3/213/3 2/212/2 14/224/14
s 2
f 5/215/5 15/225/15 14/224/14
f 14/224/14 2/212/2 5/215/5
s 32
f 6/39/6 5/38/5 12/61/12
f 12/61/12 8/56/8 6/39/6
f 7/53/7 9/58/9 92/301/92
f 4/37/4 7/53/7 92/301/92
f 3/36/3 4/37/4 92/301/92
f 76/174/76 2/24/2 90/286/90
f 92/301/92 91/202/91 90/286/90
f 3/36/3 92/301/92 90/286/90
f 2/24/2 3/36/3 90/286/90
f 5/38/5 2/24/2 76/174/76
f 12/61/12 5/38/5 76/174/76
f 51/69/51 12/61/12 76/174/76
f 11/125/11 1/123/1 93/170/93
s 4
f 1/155/1 49/156/49 93/166/93
s 32
f 88/297/88 181/390/181 183/392/183
f 183/392/183 99/308/99 88/297/88
f 181/159/181 88/157/88 79/167/79
f 79/167/79 184/161/184 181/159/181
s 1
f 80/149/80 150/163/150 190/148/190
s 4
f 80/149/80 87/152/87 150/163/150
s 32
f 79/167/79 87/154/87 80/290/80
f 79/167/79 80/290/80 190/153/190
f 79/167/79 190/153/190 184/161/184
s 0
f 89/200/89 87/199/87 79/289/79
f 79/289/79 81/291/81 89/200/89
s 64
f 79/196/79 78/288/78 81/197/81
s 16
f 184/191/184 187/192/187 186/395/186
s 0
f 184/393/184 190/206/190 192/208/192
f 192/208/192 187/396/187 184/393/184
s 8
f 170/378/170 169/95/169 71/94/71
s 4
f 170/361/170 71/35/71 58/22/58
f 58/22/58 152/62/152 170/361/170
s 1
f 152/355/152 58/101/58 57/100/57
f 57/100/57 159/368/159 152/355/152
f 57/100/57 54/97/54 161/370/161
f 161/370/161 159/368/159 57/100/57
f 54/97/54 148/271/148 161/370/161
s 0
f 51/261/51 144/353/144 145/354/145
f 51/261/51 145/354/145 13/223/13
f 51/261/51 13/223/13 12/222/12
f 11/181/11 13/223/13 145/354/145
# 383 triangles in group


# 383 triangles total























In your Asteroid3DGame.java class, create three global variables:

private float xlocation=0f;
private float ylocation=0f;
private float zlocation=-20f;


In your init game method you want to add this code:




URL model =HelloModelLoading.class.getClassLoader().
getResource("images/ship.obj");
FormatConverter converter = new ObjToJme();
ByteArrayOutputStream BO = new ByteArrayOutputStream();
BinaryImporter jbr = new BinaryImporter();
TriMesh ship = null;
ts1 = display.getRenderer().createTextureState();
ts1.setEnabled(true);
ts1.setTexture(TextureManager.loadTexture(Asteroid3DGame.class.getClassLoader() .getResource("images/lava01.jpg"), Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR));
for(int x=0;x<1;x++ ) { try { converter.convert(model.openStream(), BO);
ship = (TriMesh) jbr.load(new ByteArrayInputStream(BO.toByteArray()));
}
catch (IOException e) { e.printStackTrace(); System.exit(0); } ship.setLocalScale(.1f); ship.setRenderState(ts1);
Quaternion rotQuat = new Quaternion();
Vector3f axis = new Vector3f(1,0.5f, 1).normalizeLocal();
float angle = 90;
rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, axis);
ship.setLocalTranslation(new Vector3f(this.xlocation,this.ylocation,this.zlocation));
ship.setModelBound(new BoundingBox());
ship.updateModelBound();
scene.attachChild(ship);
}





This code loads your ship.obj model and wraps a texture around it. It converts the object into a TriMesh object so it can be added to the scene Node.
The ship.setLocalScale will set the size of the ship.

The setLocalTranslation method sets the location of the ship in your world. Add this line of code ship.setLocalRotation(rotQuat); to rotate the object. When you run your program you should see this ship object with the lava image wrapped around it.

Go To #9

Read more...