Pacman

Ok i have 2 questions.

in the piece of code below i want to put an image of pacman to be visible on the frame. Could someone give me the code to do this?

2nd does anyone have a clue where i will find images of pac man going left right up down etc in 3d. Ive been looking on the interent for ages and cant find anything.

Thanks

import java.awt.*;

import java.awt.event.*;

import javax.media.j3d.*;

import javax.vecmath.*;

public class Example01 extends Frame {

public Example01() {

super("Java 3D Example01");

setSize(400,300);

Canvas3D myCanvas3D = new Canvas3D(null);

add("Center", myCanvas3D);

setVisible(true);

addWindowListener(new WindowAdapter()

{public void windowClosing(WindowEvent e)

{dispose(); System.exit(0);}

}

);

View myView = constructView(myCanvas3D);

Locale myLocale = constructViewBranch(myView);

constructContentBranch(myLocale);

}

private View constructView(Canvas3D myCanvas3D) {

View myView = new View();

myView.addCanvas3D(myCanvas3D);

myView.setPhysicalBody(new PhysicalBody());

myView.setPhysicalEnvironment(new PhysicalEnvironment());

return(myView);

}

private Locale constructViewBranch(View myView) {

VirtualUniverse myUniverse = new VirtualUniverse();

Locale myLocale = new Locale(myUniverse);

BranchGroup myBranchGroup = new BranchGroup();

TransformGroup myTransformGroup = new TransformGroup();

ViewPlatform myViewPlatform = new ViewPlatform();

myTransformGroup.addChild(myViewPlatform);

myBranchGroup.addChild(myTransformGroup);

myLocale.addBranchGraph(myBranchGroup);

myView.attachViewPlatform(myViewPlatform);

return(myLocale);

}

private void constructContentBranch(Locale myLocale)

{

// to be renderede

}

public static void main(String args[]) {

new Example01();

}

}

[2025 byte] By [scolari21a] at [2007-10-2 4:05:38]
# 1
Try resubmitting, but formatting with the Code button.
Dick_Adamsa at 2007-7-15 23:28:22 > top of Java-index,Java Essentials,Java Programming...