Trying to make object move parabolically....

Im creating a race track where an object goes around in laps.. So far, the object is moving at straight 90 degree angles when it hits sides.. Im trying, and also wondering how to make the object curve when it turns a corner instead of hitting the edge, then turning a full 90 degree angle.... Im really stumped, first year takin Java :(
Here's what I got so far:
// The "Race" class.
import java.applet.*;
import java.awt.*;
public class Race extends Applet implements Runnable
    Dimension d = getSize ();
    Font f;
    int counter = 0;
    int xchange;
    int ychange;
    int x = 50;
    int y = d.height - 50;
    boolean beg = false;
    boolean slow = false;
    boolean medi = false;
    boolean fast = false;
    Button start, slo, med, fas, stop;
    TextField output;
    Thread t;
    Graphics bufferg;
    Image buffer;
    Image CARu, CARd, CARl, CARr, bakg;
    AudioClip intro, test;
    public void init ()
        test = getAudioClip (getCodeBase (), "1.au");
        intro = getAudioClip (getCodeBase (), "laser.au");
        Dimension d = getSize ();
        buffer = createImage (d.width, d.height);
        bufferg = buffer.getGraphics ();
        start = new Button ("Start");
        start.setBackground (Color.yellow);
        add (start);
        slo = new Button ("Slow");
        slo.setBackground (Color.yellow);
        add (slo);
        med = new Button ("Medium");
        med.setBackground (Color.yellow);
        add (med);
        fas = new Button ("Fast");
        fas.setBackground (Color.yellow);
        add (fas);
        stop = new Button ("Stop");
        stop.setBackground (Color.yellow);
        add (stop);
        CARu = getImage (getCodeBase (), "carUP.jpg");
        CARd = getImage (getCodeBase (), "carDOWN.jpg");
        CARl = getImage (getCodeBase (), "carLEFT.jpg");
        CARr = getImage (getCodeBase (), "carRIGHT.jpg");
        bakg = getImage (getCodeBase (), "bakg.jpg");
    public boolean action (Event e, Object o)
        if (e.target == start)
            beg = true;
            test.loop ();
            intro.play ();
        if (e.target == slo)
            slow = true;
            medi = false;
            fast = false;
        if (e.target == med)
            slow = false;
            medi = true;
            fast = false;
        if (e.target == fas)
            slow = false;
            medi = false;
            fast = true;
        if (e.target == stop)
            beg = false;
            slow = false;
            medi = false;
            fast = false;
            counter = 0;
            x = 50;
            y = d.height - 50;
        return true;
    public void start ()
        if (t == null)
            t = new Thread (this);
            t.start ();
    public void stop ()
        if (t != null)
            t.stop ();
            t = null;
    public boolean keyDown (Event e, int key)
        if (key == 's')
            intro.stop ();
        return true;
    public void run ()
        while (true)
            //Thread sleeps for 15 milliseconds here
            try
                t.sleep (15);
            catch (Exception e)
            Dimension d = getSize ();
            bufferg.setColor (Color.green);
            bufferg.fillRect (0, 0, d.width, d.height);
            // (d.width-50) ((d.height/3) -50)
            bufferg.drawImage (bakg, 0, 0, this);
            bufferg.setColor (Color.red);
            xchange = 0;
            ychange = 0;
            if (beg == true)
                if (x <= (d.width - 50) && y >= (d.height - 50))
                    xchange = 1;
                    if (slow == true)
                        ychange = 1;
                        xchange = 1;
                    if (medi == true)
                        ychange = 2;
                        xchange = 2;
                    if (fast == true)
                        ychange = 6;
                        xchange = 6;
                    bufferg.fillOval (x, d.height - 50, 50, 50);
                    //bufferg.drawImage (car_r, x, 300, this);
                    x += xchange;
                if (x >= (d.width - 50) && y >= ((d.height / 3) - 50))
                    ychange = 1;
                    if (slow == true)
                        ychange = 1;
                        xchange = 1;
                    if (medi == true)
                        ychange = 2;
                        xchange = 2;
                    if (fast == true)
                        ychange = 6;
                        xchange = 6;
                    bufferg.fillOval ((d.width - 50), y, 50, 50);
                    // bufferg.drawImage (car_u, 350, y, this);
                    y -= ychange;
                if (y <= ((d.height / 3) - 50) && x >= 50)
                    xchange = 1;
                    if (slow == true)
                        ychange = 1;
                        xchange = 1;
                    if (medi == true)
                        ychange = 2;
                        xchange = 2;
                    if (fast == true)
                        ychange = 6;
                        xchange = 6;
                    bufferg.fillOval (x, ((d.height / 3) - 50), 50, 50);
                    //bufferg.drawImage (car_l, x, 115, this);
                    x -= xchange;
                if (x <= 50 && y <= (d.height - 50))
                    ychange = 1;
                    if (slow == true)
                        ychange = 1;
                        xchange = 1;
                    if (medi == true)
                        ychange = 2;
                        xchange = 2;
                    if (fast == true)
                        ychange = 6;
                        xchange = 6;
                    bufferg.fillOval (50, y, 50, 50);
                    //bufferg.drawImage (car_d, 50, y, this);
                    y += ychange;
                if ((x <= 50) && (y <= (d.width - 50)) && (x <= (d.width - 50)) && (y >= (d.height - 50)))
                    counter++;
            else
            { //bufferg.drawImage (car_r, 50, 300, this);
                x = 50;
                y = d.height - 50;
                bufferg.fillOval (x, y, 50, 50);
            repaint ();
    public void update (Graphics g)
        paint (g);
    public void paint (Graphics g)
        bufferg.setColor (Color.red);
        f = new Font ("Test", Font.BOLD, 25);
        bufferg.setFont (f);
        bufferg.setColor (Color.blue);
        bufferg.drawString ("Lap " + counter, 300, 300);
        g.drawImage (buffer, 0, 0, this);
    } // paint method
} // Race classCan anyone help me please?

here's a stripped down bounded sprite engine. use the arrows keys. up=accelerate forward. down=accelerate backwards. left=turn left. right=turn right. supply a 32x32 image named "image.jpg" (or write your filename in the code below) to see the picture rotate as it corners. otherwise, you'll just see non rotating colored squares which represent the bounding box of the image. the variable turns is the number of images you will have on the screen at a time. i should have chosen a better variable name.
import java.awt.*;
import java.util.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.net.*;
import java.io.*;
public class SpriteEngine extends Applet implements Runnable, KeyListener{
     Graphics2D dbg;
     Image dbImage;
     public int gameSpeed = 100;
     public int turns = 10;
     Thread th;
     boolean forward=false, reverse=false, left=false,right=false;
     Sprite[] sprite = new Sprite[turns];
     public void init(){
          setSize(500,500);
          setBackground(Color.black);
          addKeyListener(this);
          Image image = getImage(getCodeBase(),"image.jpg");
          for(int a=0;a<turns;a++){
               sprite[a]=new Sprite(image, new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255)), new Point((int)(Math.random()*500),(int)(Math.random()*500)), Math.random()*360,Math.random()*12-6);
     public void start (){
          th = new Thread (this);
          th.start ();
     public void run ()     {
          Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
          while (true){
               checkControls();
               for(int i=0;i<turns;i++){
                    sprite.move();
               repaint();
               try     {
                    th.sleep (gameSpeed);
               }catch (InterruptedException ex){
     public void paint (Graphics2D g)     {
          for(int a=0;a<turns;a++){
               sprite[a].draw(g);
               g.setColor(Color.black);
     public void update (Graphics g)     {
          if (dbImage == null){
               dbImage = createImage (this.getSize().width, this.getSize().height);
               dbg = (Graphics2D)dbImage.getGraphics();
          dbg.setColor (getBackground ());
          dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
          dbg.setColor (getForeground());
          paint (dbg);
          g.drawImage (dbImage, 0, 0, this);
     public void keyPressed(KeyEvent e) {
          if (e.getKeyCode()==38){forward=true;}else
          if (e.getKeyCode()==40){reverse=true;}else
          if (e.getKeyCode()==37){left=true;   }else
          if (e.getKeyCode()==39){right=true;  }
     public void keyReleased(KeyEvent e) {
          if (e.getKeyCode()==38){forward=false;}else
          if (e.getKeyCode()==40){reverse=false;}else
          if (e.getKeyCode()==37){left=false;   }else
          if (e.getKeyCode()==39){right=false;  }
     public void keyTyped(KeyEvent e) {}
     public void checkControls(){
          for(int a=0;a<turns;a++){
               if (forward){sprite[a].accel() ;}
               if (reverse){sprite[a].deccel() ;}
               if (left) {sprite[a].turnLeft() ;}
               if (right) {sprite[a].turnRight();}
class Sprite extends Object {
     private Image image;
     AffineTransform imageLocation=new AffineTransform();
     double velocity;
     Rectangle bounds;
     Rectangle refShape=new Rectangle(32,32);
     double MaxSpeed=6;
     double AccelRate=.3;
     public double Rotation=6;
     double posX,posY,angle;
     Color boxColor;
     public boolean keyDown = false;
     double dx,dy;
     public Sprite(Image img, Color color, Point location, double ang, double speed){
          posX=location.x;          posY=location.y;          boxColor = color;
          image=img;                    velocity=speed;               angle=ang;
          bounds=new Rectangle((int)posX,(int)posY,32,32);
     public void draw(Graphics2D g){
          g.setColor(boxColor);
          g.fill((bounds));
          g.setColor(Color.black);
          g.drawImage(image,imageLocation,null); //this draws your image with the AffineTranform applied
     public void setLocation(Point point) {posX=point.x; posY=point.y; }
     public Point getLocation() {return bounds.getLocation();}
     public void setBounds(Rectangle rect){bounds=rect;                }
     public Rectangle getBounds() {return bounds;              }
     public void setSpeed(double speed) {velocity=speed;                 }
     public double getSpeed() {return velocity;            }
     public void setAngle(double theta) {angle=theta;                }
     public double getAngle() {return angle;               }
     public void turnLeft() {angle=angle-Rotation;       }
     public void turnRight() {angle=angle+Rotation;       }
     public AffineTransform getForm() {return imageLocation;          }
     public void setForm(AffineTransform xform){                       }
     public void accel(){if(velocity<MaxSpeed){velocity=velocity+AccelRate;}}
     public void deccel(){if(velocity> -MaxSpeed){velocity=velocity-AccelRate;}}
     public void move(){
          dx=Math.cos(Math.toRadians(angle))*velocity;
          dy=Math.sin(Math.toRadians(angle))*velocity;
          posX=posX+dx;
          posY=posY+dy;
          imageLocation=AffineTransform.getTranslateInstance(posX,posY); //these two line set the affinetransform
          imageLocation.rotate(Math.toRadians(angle)+Math.PI/2,16,16); //to the right place and angle.
          bounds.setLocation((int)posX,(int)posY);
          if(!keyDown){
               if (velocity<0){
                    velocity=velocity+.15; // -drag
               }else if (velocity>0){
                    velocity=velocity - 0.15; // +drag

Similar Messages

  • Hi, haven't used iMovie in years.  I shot some video with my cell phone camera (Samsung Galaxy S2).  When I tried to make a movie, the clips I downloaded played back sideways on iMovie.  Is there any way I an flip the video from horizontal to vertical?

    Hi, haven't used iMovie in years.  I shot some video with my cell phone camera (Samsung Galaxy S2).  When I tried to make a movie, the clips I downloaded played back sideways on iMovie.  Is there any way I an flip the video from horizontal to vertical?  Thanks.

    You actually want a vertical video??
    What would you show that on?!
    Rotating video or photos in iMovie 11:
    http://help.apple.com/imovie/#mov3a884fd3
    In earlier versions of iMovie you can also do this using Quicktime Pro 7:
    Open MOV file in QT Pro (QT 7.6.6)
    Window -> Show Movie Properties
    select "Video Track"
    select "Visual Settings" from lower window
    check "Preserve Aspect Ratio"
    Click on appropriate rotation icon (MOV rotates!)
    Click back on the open MOV in Player Window
    FILE -> Save
    You can also do this using TransformMovie, available here:
    http://www.macupdate.com/info.php/id/21859

  • Behaviours make objects move in jumps when they are put far from origin.

    Hi, i am trying to represent the solar system in java3d, but i have a problem that when you put an object at a point eg.(10000000,10000000,10000000) using a transform3d then attach a behaviour like keyboardbehavior to it, it moves in big jumps instead of smoothly. It will mroe smoothly the closer you are to the origin.
    Can anybody give me some help as to why this might be.
    Also, Am i using the right type of universe e.g SimpleUniverse, or do I need to use one with a HighresCoord or something.
    Thanks

    Search Spherical Linear Interpolation.
    Gives you smooth transitions between vectors and rotations.
    v(t) = (sin(1-t)Q) / sin Q * v1 + (sin(t)Q)/sinQ * v2
    where Q is the angle between the two vectors.
    Q = acos(v1.dot(v2))
    check out http://www.gamedev.net/reference/articles/article1824.asp

  • Trying to make HD movie to play on TV

    Seems after I use media browser to make a HD movie in imovie, it will not play on TV's, just the computer. Any assistance would be appreciated.

    Hi
    How do You go from Mac to TV ?
    Is it via making a DVD - Then
    • DVD (made with whatever program) is as standard only - interlaced SD-Quality
    (Yes even bought ones)
    To make things worse
    • Making the movie in iMovie'08 or 09 or 11 will discard the final quality even more as they discard every second line when moving material into a Movie Project. This can not be repaired. And full interlaced SD-Quality can not be exported to any DVD Authoring program as iDVD, DVD Studio Pro or Roxio Toast™
    So to get an as good DVD possibly I use
    • iMovie up to HD6 - or -
    • FinalCut any version
    • (threoretically one can use QuickTime Pro to edit material - but very very tedious - still 100% quality)
    and
    • iDVD (as I prefere this)
    • DVD Studio Pro
    • Roxio Toast™
    If not via DVD - then I use an USB-Memory stick (DOS formatted)
    • In iMovie'11 - Export as QuickTime - .mp4 ---> .H264
    this I plug into a PlayStation 3 - or directly into a flat-screen TV
    If I need HD - then I burn as a Blu-Ray Disk -
    • using Roxio Toast™ incl BD-component
    • onto a standard DVD-R disk (max 20 minutes) - BUT ONE MUST have a Blu-Ray-Player to view it as a PlayStation3
    (I have no BD-Burner or disks)
    Yours Bengt W

  • Edited Clips resized when trying to make a movie

    I've went through my videos and have the clips that I want to keep. When I go back in and add them to a new sequence, they are zoomed in for some reason. So I thought I had some setting wrong. But when I bring a new video clip in that I haven't edited and drag it to the timeline it isn't zoomed in. I have been messing around with this for days, can't see where I've gone wrong. Any help would be great

    Please provide
    these details to help us help you.
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • I can make a mov OK but got wrong framerate for avi

    Hi,
    I modified the jpegtoMovie.java to generate a avi file.
    I set up a int[] buffer to store the rgb values and stream it out
    to a file. When the format is QuickTime, everything is fine, however
    when I changed to AVI format, the windows media player played it really
    fast. Windows shows it got a framerate of 1000 and a duration of 0.
    I tried to modify the data source to return a duration other then unknown, but it doesn't work.
    Any one got any ideas? Attached is the source
    Thank you!
    Gang
    import java.io.*;
    import java.util.*;
    import java.awt.Dimension;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import javax.media.format.VideoFormat;
    * This program takes a list of JPEG image files and convert them into
    * a QuickTime movie.
    public class movieAdapter implements ControllerListener, DataSinkListener {
    private boolean doIt(int width, int height, int frameRate, MediaLocator outML) {
         ImageDataSource ids = new ImageDataSource(width, height, frameRate);
         Processor p;
         try {
         System.err.println("- create processor for the image datasource ...");
         p = Manager.createProcessor(ids);
         } catch (Exception e) {
         System.err.println("Yikes! Cannot create a processor from the data source.");
         return false;
         p.addControllerListener(this);
         // Put the Processor into configured state so we can set
         // some processing options on the processor.
         p.configure();
         if (!waitForState(p, p.Configured)) {
         System.err.println("Failed to configure the processor.");
         return false;
         // Set the output content descriptor to QuickTime.
         p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.MSVIDEO));
         // Query for the processor for supported formats.
         // Then set it on the processor.
         TrackControl tcs[] = p.getTrackControls();
         Format f[] = tcs[0].getSupportedFormats();
         if (f == null || f.length <= 0) {
         System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
         return false;
         tcs[0].setFormat(f[0]);
         System.err.println("Setting the track format to: " + f[0]);
         // We are done with programming the processor. Let's just
         // realize it.
         p.realize();
         if (!waitForState(p, p.Realized)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Now, we'll need to create a DataSink.
         DataSink dsink;
         if ((dsink = createDataSink(p, outML)) == null) {
         System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
         return false;
         dsink.addDataSinkListener(this);
         fileDone = false;
         System.err.println("start processing...");
         // OK, we can now start the actual transcoding.
         try {
         p.start();
         dsink.start();
         } catch (IOException e) {
         System.err.println("IO error during processing");
         return false;
         // Wait for EndOfStream event.
         waitForFileDone();
         // Cleanup.
         try {
         dsink.close();
         } catch (Exception e) {}
         p.removeControllerListener(this);
         System.err.println("...done processing.");
         return true;
    * Create the DataSink.
    private DataSink createDataSink(Processor p, MediaLocator outML) {
         DataSource ds;
         if ((ds = p.getDataOutput()) == null) {
         System.err.println("Something is really wrong: the processor does not have an output DataSource");
         return null;
         DataSink dsink;
         try {
         System.err.println("- create DataSink for: " + outML);
         dsink = Manager.createDataSink(ds, outML);
         dsink.open();
         } catch (Exception e) {
         System.err.println("Cannot create the DataSink: " + e);
         return null;
         return dsink;
    private Object waitSync = new Object();
    private boolean stateTransitionOK = true;
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    private boolean waitForState(Processor p, int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() < state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         evt.getSourceController().stop();
         evt.getSourceController().close();
    private Object waitFileSync = new Object();
    private boolean fileDone = false;
    private boolean fileSuccess = true;
    * Block until file writing is done.
    private boolean waitForFileDone() {
         synchronized (waitFileSync) {
         try {
              while (!fileDone)
              waitFileSync.wait();
         } catch (Exception e) {}
         return fileSuccess;
    * Event handler for the file writer.
    public void dataSinkUpdate(DataSinkEvent evt) {
         if (evt instanceof EndOfStreamEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              waitFileSync.notifyAll();
         } else if (evt instanceof DataSinkErrorEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              fileSuccess = false;
              waitFileSync.notifyAll();
    public static void main(String args[]) throws Exception{
    //jpegCreator.main(null);
         //if (args.length == 0)
         // prUsage();
         // Parse the arguments.
         int i = 0;
         int width = -1, height = -1, frameRate = 1;
         Vector inputFiles = new Vector();
         String outputURL = null;
    width=128;
    height=128;
    outputURL="test.avi";
         // Generate the output media locators.
         MediaLocator oml;
         if ((oml = createMediaLocator(outputURL)) == null) {
         System.err.println("Cannot build media locator from: " + outputURL);
         System.exit(0);
         movieAdapter imageToMovie = new movieAdapter();
         imageToMovie.doIt(width, height, frameRate, oml);
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...");
         System.exit(-1);
    * Create a media locator from the given string.
    private static MediaLocator createMediaLocator(String url) {
         MediaLocator ml;
         if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
         return ml;
         if (url.startsWith(File.separator)) {
         if ((ml = new MediaLocator("file:" + url)) != null)
              return ml;
         } else {
         String file = "file:" + System.getProperty("user.dir") + File.separator + url;
         if ((ml = new MediaLocator(file)) != null)
              return ml;
         return null;
    // Inner classes.
    * A DataSource to read from a list of JPEG image files and
    * turn that into a stream of JMF buffers.
    * The DataSource is not seekable or positionable.
    private class ImageDataSource extends PullBufferDataSource {
         private ImageSourceStream streams[];
         ImageDataSource(int width, int height, int frameRate) {
         streams = new ImageSourceStream[1];
         streams[0] = new ImageSourceStream(width, height, frameRate);
         public void setLocator(MediaLocator source) {
         public MediaLocator getLocator() {
         return null;
         * Content type is of RAW since we are sending buffers of video
         * frames without a container format.
         public String getContentType() {
         return ContentDescriptor.RAW;
         public void connect() {
         public void disconnect() {
         public void start() {
         public void stop() {
         * Return the ImageSourceStreams.
         public PullBufferStream[] getStreams() {
         return streams;
         * We could have derived the duration from the number of
         * frames and frame rate. But for the purpose of this program,
         * it's not necessary.
         public Time getDuration() {
    System.out.println("dur is "+streams[0].nextImage);
    //return new Time(1000000000);
    return DURATION_UNKNOWN;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    * The source stream to go along with ImageDataSource.
    class ImageSourceStream implements PullBufferStream {
         final int width, height;
         final VideoFormat format;
         int nextImage = 0;     // index of the next image to be read.
         boolean ended = false;
         public ImageSourceStream(int width, int height, int frameRate) {
         this.width = width;
         this.height = height;
    final int rMask = 0x00ff0000;
    final int gMask = 0x0000FF00;
    final int bMask = 0x000000ff;
    format=new javax.media.format.RGBFormat(new Dimension(width,height),Format.NOT_SPECIFIED,
    Format.intArray,frameRate,32,rMask,gMask,bMask);
         * We should never need to block assuming data are read from files.
         public boolean willReadBlock() {
         return false;
         * This is called from the Processor to read a frame worth
         * of video data.
         public void read(Buffer buf) throws IOException {
         // Check if we've finished all the frames.
         if (nextImage >= 100) {
              // We are done. Set EndOfMedia.
              System.err.println("Done reading all images.");
              buf.setEOM(true);
              buf.setOffset(0);
              buf.setLength(0);
              ended = true;
              return;
         nextImage++;
         int data[] = null;
         // Check the input buffer type & size.
         if (buf.getData() instanceof int[])
              data = (int[])buf.getData();
         // Check to see the given buffer is big enough for the frame.
         if (data == null || data.length < width*height) {
              data = new int[width*height];
              buf.setData(data);
    java.awt.Color clr=java.awt.Color.red;
    if(nextImage>30)clr=java.awt.Color.GREEN;
    if(nextImage>60)clr=java.awt.Color.BLUE;
    for(int i=0;i<width*height;i++){
    data=clr.getRGB();
         buf.setOffset(0);
         buf.setLength(width*height);
         buf.setFormat(format);
         buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);
         * Return the format of each video frame. That will be JPEG.
         public Format getFormat() {
         return format;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public long getContentLength() {
         return 0;
         public boolean endOfStream() {
         return ended;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;

    Hi
    I'm trying to make a movie from the JpegImagesToMovie class. But i get a null point exception :(
    java.lang.NullPointerException
         at com.sun.media.multiplexer.video.QuicktimeMux.writeVideoSampleDescription(QuicktimeMux.java:936)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeSTSD(QuicktimeMux.java:925)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeSTBL(QuicktimeMux.java:905)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeMINF(QuicktimeMux.java:806)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeMDIA(QuicktimeMux.java:727)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeTRAK(QuicktimeMux.java:644)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeMOOV(QuicktimeMux.java:582)
         at com.sun.media.multiplexer.video.QuicktimeMux.writeFooter(QuicktimeMux.java:519)
         at com.sun.media.multiplexer.BasicMux.close(BasicMux.java:142)
         at com.sun.media.BasicMuxModule.doClose(BasicMuxModule.java:172)
         at com.sun.media.PlaybackEngine.doClose(PlaybackEngine.java:872)
         at com.sun.media.BasicController.close(BasicController.java:261)
         at com.sun.media.BasicPlayer.doClose(BasicPlayer.java:229)
         at com.sun.media.BasicController.close(BasicController.java:261)
         at movieclear.MovieManager.JpegImagesToMovie.controllerUpdate(JpegImagesToMovie.java:179)
         at com.sun.media.BasicController.dispatchEvent(BasicController.java:1254)
         at com.sun.media.SendEventQueue.processEvent(BasicController.java:1286)
         at com.sun.media.util.ThreadedEventQueue.dispatchEvents(ThreadedEventQueue.java:65)
         at com.sun.media.util.ThreadedEventQueue.run(ThreadedEventQueue.java:92)
    Please please help me out.. I'm totally stuck in this thing. A MOV file is created, but it's a 0kb file.
    Please help me out..
    Sootie.

  • Very new to photoshop I am trying to make changes to a photo and set it up as a smart object but after selecting smart object, the checkerboard appears and my photo dissppears

    Very new to photoshop I am trying to make changes to a photo and set it up as a smart object but after selecting smart object, the checkerboard appears and my photo dissppears

    Hello, thank you so much for your response! Here are some screenshots of my steps taken

  • I'm trying to watch a movie from my iPad on my tv with Hdmi  cable.  Do I need to do anything to the tv to make this work?

    I'm trying to watch a movie from my iPad on my tv with Hdmi  cable.  Do I need to do anything to the tv to make this work?

    Not really. Using the correct Digital Av adapter and connecting the iPad to the Tv through one of its HDMI ports is all it takes. Of course making sure the correct input is selected in the Video source selection on the TV.

  • I rented an HD movie in iTunes by mistake. Can I switch the rental to SD version before starting to watch it? Trying to make room on iPad.

    I rented an HD movie in iTunes by mistake. Can I switch the rental to SD version before starting to watch it? Trying to make room on iPad for more rentals to take with me on trip.

    You can get the SD or 720p version by:
    Open iTunes 11
    Click iTunes in menu bar > select Preferences...
    Click on the Store tab
    Change When downloading High Definition videos, prefer dropdown to 720p > click OK
    Click on the iTunes Store button
    Click Purchased link
    Click Movies tab
    You should now see a download icon for the movies you already have 1080p version of.
    Click on this download icon to download the 720p version.
    This will put a 720p version in the same folder on your hard drive as the 1080p version.  If you have iTunes setup to play 1080p when available, it will play the 1080p version.  When you connect your iPad 1, it will sync the 720p version.
    Don't forget to change your preference back to 1080p so you can continue to get the higher quality version.

  • I'm trying to make an android game and I want that when a collision with another object change of sc

    I'm trying to make an android game and I want that when a collision with another object change of scene
    how i can do this

    here is the doc on htiTestObject for detecting collisions.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#hitTestObject()
    for scene change use the second parameter in gotoandplay() to define scene name doc below
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip .html#gotoAndPlay()

  • Just bought Photoshop Elements 13...I'm trying to make a slideshow but can't figure out how to alter duration time that the slide is on the screen.  They presently move from one to another way too quickly...also need a different pan and zoom option.  Wher

    Just bought Photoshop Elements 13...I'm trying to make a slideshow but can't figure out how to alter duration time that the slide is on the screen.  They presently move from one to another way too quickly...also need a different pan and zoom option.  Where are all the options I had in PS10?  Also...Can I burn this to a DVD?

    The changes have brought improvements but also drawbacks compared with the old slideshow editor.
    The templates are now fairly fixed but I find the “Classic Dark” gives reasonable results with some panning and you can click the audio button and browse you PC for any track. Unfortunately there are only three speed choices linked to the music track. The improvement for most people is that you can now export to your hard drive at 720p or 1080p and upload to sites like YouTube and Vimeo.

  • I am trying to rent a movie on my Apple tv keep getting the message - verification required before you can make purchases you must go to the itunes store on your computer and verify your payment information

    Hi  I am Del
    I am trying to rent a movie on my Apple tv keep getting the message - verification required before you can make purchases you must go to the itunes store on your computer and verify your payment information
    Thanks

    Have you paired your Apple Tv with your iTunes account?  That's how rentals and purchases are billed.  If, however, you have already done that it is possible that there is a glitch in the system.  I've had that happen occasionally and it usually goes away if I reset Apple Tv.  On one occasion that I didn't work so I had to go to iTunes and deauthorize and then authorize this computer.  Also, check to see if your Home Sharing is on (under File in iTunes).  Hope that helps.

  • Trying to make iDVD with 22 separate movies

    I am currently trying to make an iDVD menu that has 22 separate movies. I can only seem to fit about 6 movie (buttons) in my "chapters" menu. I don't have to have all 22 movies linked on one page, but I can't figure out how to add extra pages that are the same. For example... I would like to have 4 chapters pages that you can simply look at page 1, 2, 3, and so on. If this isn't possible, can you please let me know how I can get all of these movies listed. I am starting to lose my mind trying to figure this out.
    Thank you so much

    This can be done by creating additional menus or submenus. This is from iDVD Help:
    +_Adding menus to an iDVD project_+
    +Depending on which theme you choose, the menus in your iDVD project can hold either 6 or 12 buttons. If you need more buttons on a menu than your theme allows, or if you need additional menus to organize the content of your DVD, you can create submenus.+
    +Submenus give you flexibility in organizing your DVD. For example, perhaps you have several slideshows in your project. You can create a button on your main menu that links to a slideshow submenu that includes links to each of your slideshows. You can also create submenus for additional movies, extra features, and so on.+
    +To add a submenu:+
    +Make sure the menu to which you want to add a submenu is showing in the iDVD window.+
    +Click the Add button (the plus sign at the bottom left corner of the window), and choose Add Submenu from the pop-up menu.+
    +A placeholder button labeled My Submenu appears on the menu. It has the default button style for the theme, so you may need to change it to match other buttons on the menu.+
    +Click the placeholder label for the new button once to highlight it, and type a new name for the button.+
    +When you click the label to highlight it, a light blue background appears behind the text.+
    +Using the pop-up menus in the in-place control that appears, change the typeface, font style, and font size of the button name if you want.+
    +To open the new submenu, double-click the newly added button. Notice that iDVD automatically applies the Extras menu style from your project’s theme to the submenu. Also, a Back button that returns to the previous menu appears on the submenu. You can now edit this menu just as you edit any other menu, changing its theme if you want. You can even use the Add button to create buttons that navigate to sub-submenus.+
    I hope this helps.

  • When trying to make a purchase for a movie I get a security information required field then I select continue and it brings me back to original screen to purchase movie. Please help.

    When trying to make a purchase for a movie I get a security information required field then I select continue and it brings me back to original screen to purchase movie. Please help.

    It's telling you to verify your billing information (credit card, address, security code), which needs to be done in iTunes via computer.

  • When i move a clip into the top project screen, it cuts off about an inch of video. im trying to make a chin face video so i need that inch. any help?

    when i move a clip into the top project screen, it cuts off about an inch of video. im trying to make a chin face video so i need that inch. any help?

    1) Make sure that your project is in the same aspect ratio as your camera. If your camera shoots 16:9. make a 16:9 project.
    2) Check the clip inspector for the clip in your project to see if Image Stabilization is turned on. Stabilization works by zooming in, so you may want to turn it off.

Maybe you are looking for