Coordinate axis

how can I draw a coordinate axis in java3d? I want to draw a 3 lines but there's a problem with displaying it on screen.
It's only part of my code:
.... {...      LineArray line = new LineArray(4,GeometryArray.COORDINATES);
        line.setCoordinate( 2, new Point3f(0.0f, 0.2f, 0.0f));
        shape.setGeometry(line);
        root.addChild(objTrans);}....and that's ok, there's a line and everything is ok but....if I add another line
LineArray line2 = new LineArray(4,GeometryArray.COORDINATES);
        line2.setCoordinate( 2, new Point3f(0.0f, 0.2f, 0.0f));
         shape.setGeometry(line2);
        LineArray line = new LineArray(4,GeometryArray.COORDINATES);
        line.setCoordinate( 2, new Point3f(0.2f, 0.0f, 0.0f));
        shape.setGeometry(line);
        root.addChild(objTrans);I can see only one line :/
I don't know if I use this objects well :/. Anybody know what's wrong?
PS. I'm not good enough at Java3d (I've just started and I have to write this program to school for 2 days:/)
Thanks in advance

You have not gone throught the Chapter2 of Java3D for Creating Geometry.
[http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch2.pdf]
In the link below, there are samples , you can read those.
[http://java.sun.com/developer/onlineTraining/java3d/index.html]
*      Axis.java 1.0 98/11/25
* Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
* Getting Started with the Java 3D API
* written in Java 3D
* This program demonstrates:
*   1. writing a visual object class
*      In this program, Axis class defines a visual object
*      This particular class extends Shape3D
*      See the text for a discussion.
*   2. Using LineArray to draw 3D lines.
import javax.media.j3d.*;
import javax.vecmath.*;
    public class Axis extends Shape3D{
     // create axis visual object
     public Axis() {
         this.setGeometry(createGeometry());
     private Geometry createGeometry(){
         // create line for X axis
            IndexedLineArray axisLines = new IndexedLineArray(18, GeometryArray.COORDINATES, 30);
         axisLines.setCoordinate( 0, new Point3f(-1.0f, 0.0f, 0.0f));
         axisLines.setCoordinate( 1, new Point3f( 1.0f, 0.0f, 0.0f));
         axisLines.setCoordinate( 2, new Point3f( 0.9f, 0.1f, 0.1f));
         axisLines.setCoordinate( 3, new Point3f( 0.9f,-0.1f, 0.1f));
         axisLines.setCoordinate( 4, new Point3f( 0.9f, 0.1f,-0.1f));
         axisLines.setCoordinate( 5, new Point3f( 0.9f,-0.1f,-0.1f));
         axisLines.setCoordinate( 6, new Point3f( 0.0f,-1.0f, 0.0f));
         axisLines.setCoordinate( 7, new Point3f( 0.0f, 1.0f, 0.0f));
         axisLines.setCoordinate( 8, new Point3f( 0.1f, 0.9f, 0.1f));
         axisLines.setCoordinate( 9, new Point3f(-0.1f, 0.9f, 0.1f));
         axisLines.setCoordinate(10, new Point3f( 0.1f, 0.9f,-0.1f));
         axisLines.setCoordinate(11, new Point3f(-0.1f, 0.9f,-0.1f));
         axisLines.setCoordinate(12, new Point3f( 0.0f, 0.0f,-1.0f));
         axisLines.setCoordinate(13, new Point3f( 0.0f, 0.0f, 1.0f));
         axisLines.setCoordinate(14, new Point3f( 0.1f, 0.1f, 0.9f));
         axisLines.setCoordinate(15, new Point3f(-0.1f, 0.1f, 0.9f));
         axisLines.setCoordinate(16, new Point3f( 0.1f,-0.1f, 0.9f));
         axisLines.setCoordinate(17, new Point3f(-0.1f,-0.1f, 0.9f));
            axisLines.setCoordinateIndex( 0, 0);
            axisLines.setCoordinateIndex( 1, 1);
            axisLines.setCoordinateIndex( 2, 2);
            axisLines.setCoordinateIndex( 3, 1);
            axisLines.setCoordinateIndex( 4, 3);
            axisLines.setCoordinateIndex( 5, 1);
            axisLines.setCoordinateIndex( 6, 4);
            axisLines.setCoordinateIndex( 7, 1);
            axisLines.setCoordinateIndex( 8, 5);
            axisLines.setCoordinateIndex( 9, 1);
            axisLines.setCoordinateIndex(10, 6);
            axisLines.setCoordinateIndex(11, 7);
            axisLines.setCoordinateIndex(12, 8);
            axisLines.setCoordinateIndex(13, 7);
            axisLines.setCoordinateIndex(14, 9);
            axisLines.setCoordinateIndex(15, 7);
            axisLines.setCoordinateIndex(16,10);
            axisLines.setCoordinateIndex(17, 7);
            axisLines.setCoordinateIndex(18,11);
            axisLines.setCoordinateIndex(19, 7);
            axisLines.setCoordinateIndex(20,12);
            axisLines.setCoordinateIndex(21,13);
            axisLines.setCoordinateIndex(22,14);
            axisLines.setCoordinateIndex(23,13);
            axisLines.setCoordinateIndex(24,15);
            axisLines.setCoordinateIndex(25,13);
            axisLines.setCoordinateIndex(26,16);
            axisLines.setCoordinateIndex(27,13);
            axisLines.setCoordinateIndex(28,17);
            axisLines.setCoordinateIndex(29,13);
            return axisLines;
     } // end of Axis createGeometry()
    } // end of class Axis

Similar Messages

  • Coordinate axis in 3D picture

    hello everyone,
    want to put a coordinate system in a 3D-Picture(not a Graph), to display a 3D model or geometry with axises.
    i think, maybe put the model or geometry direct in a 3D-Graph is a way to realize, but still have not had a try.
    anyone has any idea?  
    Solved!
    Go to Solution.

    In the early day of the public beta of that tool, I used cones and cylinders to construct a coordinate axis. That code is long gone now but figuring out how to do it ammounted to a nice learning exercise.
    Have fun,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Local rotation problem

    I am programming a spaceship moving around in Java3D.
    My problem is that I want the ship to be able to rotate around its z-axis(roll) and along its x-axis(nose up or down), when I am doing this however only one of the axis will follow the ships local coordinates.
    The scene looks like this.
    BG - TG1 - TG2 - Model
    TG2 is the z-axis rotation, and that works fine since it will rotate when T1, the x-axis rotation rotates. T1 however will be fixed to the world and not be affected by TG2s rotation...
    How do I make both rotations move along the axis of the local coordinates of the ship, instead of the world axis (BG axis).

    That does not matter, one rotation will cone first and that will mess up the other one. It seems like the first rotation is always locked to the world coordinate axis.
    This is my behavior code (after combining both transform groups into one):
    class FighterRotate extends Behavior
         double angleX;
         double angleZ;
         TransformGroup targetTG;
         Transform3D rotationX;
         Transform3D rotationZ;
         KeyEvent evt;
         WakeupOnAWTEvent awaken;
         FighterRotate(TransformGroup TG)
              angleX = 0;
              angleZ = 0;
              targetTG = TG;
              rotationX = new Transform3D();
              rotationZ = new Transform3D();
              awaken = new WakeupOnAWTEvent(KeyEvent.KEY_PRESSED);
         public void initialize()
              this.wakeupOn(awaken);
         public void processStimulus(Enumeration criteria)
              evt = (KeyEvent)awaken.getAWTEvent()[0];
              if (evt.getKeyCode() == KeyEvent.VK_UP)
                   angleX += 0.1;
              if (evt.getKeyCode() == KeyEvent.VK_DOWN)
                   angleX -= 0.1;
              if (evt.getKeyCode() == KeyEvent.VK_RIGHT)
                   angleZ += 0.1;
              if (evt.getKeyCode() == KeyEvent.VK_LEFT)
                   angleZ -= 0.1;
                   rotationX.rotX(angleX);
                   rotationZ.rotZ(angleZ);
                   rotationX.mul(rotationZ);
                   targetTG.setTransform(rotationX);
              this.wakeupOn(awaken);
    How can I change this to make my model move as it should?

  • How to animate 3D text

    This is a issue sI am having, anyone come across this?
    Our computer platform: Mac OS 10.10
    Photoshop/Lightroom version: Photoshop CC 2014
    I am trying to animate 3D extruded letters.  I had previously done this on PS 6 extended without issues. 
    Now when I split the extrusion, I can select the individual letters without an issue.  I can get them on the timeline without a problem.  When I try to roll them around a coordinate axis, they go randomly shooting off in different direction.  I have tried this by manipulating the coordinates directly and also the visual tool.  Both of this yield the same weird behavior. 
    I have reset my preferences and even uninstalled and reinstalled PSCC14
    Any help you could provide would be greatly appreciated.
    Thanks in advance,
    David

    Have you ever found the solution to this problem?
    I'm having the same issue...works fine in CS6 but not in CC 2014.

  • SoftMotion: Using an axis in different coordinate spaces

    Hi,
    I am trying to set up a SoftMotion system with up to 5 axes and using these axes in different configurations usings coordinate systems.
    Problem is:
    I have axes X1, X2 which are running in parallel, as well as axes Y, Z and W.
    First setup is running only X1 and X2, all other drives need to be disabled. Move start and stop must be synched -> Use "Coordinate Space A"
    Second setup is running X1,X2 and Y, all other drives need to be disabled. Move start and stop must be synched -> Use "Coordinate Space B"
    etc.
    Unfortunately an axis that has been configured for "Coordinate Space A" can not be configured to be used in "Coordinate Space B".
    Configuring all available axes to be used in a single coordinate space will result in an error when trying to perform a move and one or more axes are drive disabled.
    Any suggestions?
    Regards,
    Swen

    Hi Swen,
    Depending on the moves you are making, you could put all of the axes in the same coordinate space and only perform moves on certain axes. This would work well with straight line moves, but not as well with arc moves. For example, I could put X1, X2, Y, W, and Z all in the same coordinate space. When I want to move X1 and X2, I command a straight line move on the coordinate that only moves axes X1 and X2 and keeps the other axes stationary. The stationary axes would still be enabled, but they wouldn't be moving.
    I might be able to come up with some more suggestions if you give me more information about your requirements.
    Thanks,
    Paul B.
    Motion Control R&D

  • Find axis value based on coordinates.

    I am trying to create a zoom in function for my chart. In
    order to do this, I need to find the values of the y axis at
    certain points. Is there anyway to use the y coordinates in order
    to find the values on the axis?

    I am trying to create a zoom in function for my chart. In
    order to do this, I need to find the values of the y axis at
    certain points. Is there anyway to use the y coordinates in order
    to find the values on the axis?

  • How to set word Graph X axis coordinate​s location

    I use the Report Generation tools to insert a Graph Plotting displayed on the Word , the following chart (1)
    Problems :How to put down X axis coordinates of the following, from Report Generation were no related tools, not aware of any other method, the manual only know that the plan is as follows (2)

    Hi, fong_ui:
    There is a VI named
    "Word_set_scale.vi"
    inside
    ..\National instruments xxx\VI.LIB\ADDONS\_OFFICE\_WORDSUB.LLB
    That is called to set the scale of a chart.
    If you open it, you will see that only "minimumscale" and "maximumscale" are set.
    You can add another property, named "CrossesAt" and set it's value to "minimumscale"
    Notice that if you change and save this VI you will be modifying ReportGenerationToolkit, so every VI that call to "Word_set_scale.vi" will follow the modified version.
    Hope it helps,
    Aitortxo.

  • Collisions (Separating Axis Theorem)

    Hi,
    I'm working on a 2D game, it's top-down like GTA2, but I'm havinfgproblems with the collision detector. I know there are a lot of posts about collision already but they didn't help me much. I'm using the separating axis theorem (explained here: http://www.harveycartel.org/metanet/tutorials/tutorialA.html#section1) and most of the code is inspired by http://www.codeproject.com/cs/media/PolygonCollision.asp .
    Separating axis theorem:
    find all axis perpendicular to all the edges of both objects,
    project both objects on the axis,
    if there is an axis where the projections do not overlap, then the objects do not overlap.
    The problem is that I think my code should work. And guess what, it doesn't. I checked the code 30 times this weekend but maybe there is some tiny mistake I overlook each time..
    When I run the program with 6 objects I get this:
    1 2 3 4 5 6
    1: - 0 0 0 0 0
    2: 0 - 1 0 0 0
    3: 0 1 - 0 0 0
    4: 0 0 0 - 0 0
    5: 0 0 0 0 - 0
    6: 0 0 0 0 0 - (1=intersect, 0=doesn't intersect)
    but this is completely wrong. You can run the program yourself to see the exact locations of the objects.
    1 is the triangle at the top,
    2 and 3 are the triangles who share an edge
    4 is the one on the left intersecting with 3
    5 is the triangle on the right
    6 is the parallelogram
    But it really gets weird when I add a 7th object (the one in the comments):
    1 2 3 4 5 6 7
    1: - 0 0 0 0 0 0
    2: 0 - 0 0 0 0 0
    3: 0 0 - 0 0 0 0
    4: 0 0 0 - 0 0 0
    5: 0 0 0 0 - 0 0
    6: 0 0 0 0 0 - 0
    7: 0 0 0 0 0 0 -
    Now 2 and 3 don't intersect anymore! They didn't change I just added another object.
    I'm adding a short explanationof all the classes and the code itself. I know it's a lot of code but I added all the test classes so you can just run Test.Test
    I hope someone can help me with this.
    Thanks,
    El Bandano
    _<h5>package CollisionDetector:</h5>_
    <h6>CollisionDetector</h6>
    The class that is supposed to check for collisions. It will take 2 Props and return a CollisionResult
    <h6>CollisionResult</h6>
    A small class with 2 public fields. For now only the boolean Intersect matters.
    <h6>Interval</h6>
    Another small class that represents an interval of floats. It's pretty simple. Distance should return something negative if 2 intervals overlap.
    _<h5>package World</h5>_
    <h6>MovableProp</h6>
    An interface of an object. All objects should be convex.
    <h6>Vector2D</h6>
    A 2D-vector. It has an x and a y value (floats) and some simple methods. a 2D vector can represent a point or an edge/axis. For a point the x and y are the coordinates. For an axis you need a normalized vector (x^2+y^2=1) and the x and y are coordinates on a parrallell line through (0,0).
    _<h5>package Test</h5>_
    <h6>Test</h6>
    The main class. It makes some objects, prints a matrix showin which intersect eachother and shows a window with all objects.
    <h6>TestMovProp</h6>
    A basic implementation of MovableProp.
    <h6>TestPanel</h6>
    A panel that draws MovableProp.
    _<h5>package CollisionDetector:</h5>_
    <h6>CollisionDetector</h6>
    package CollsisionDetector;
    import World.MovableProp;
    import World.Vector2D;
    import java.util.ArrayList;
    public class CollisionDetector {
        public CollisionDetector(){
        public CollisionResult DetectCollision(MovableProp propA, MovableProp propB) {
            CollisionResult result = new CollisionResult();
            result.Intersect = true;
            result.WillIntersect = true;
            Vector2D[] edges = UniqueEdges(propA, propB);
            // loop through the edges
            // find an axis perpendicular to the edge
            // project the props on the axis
            // check wether they intersect on that axis
            for (Vector2D edge: edges){
                Vector2D axis = edge.getPerpendicular();
                Interval intA = projectPointsOnAxis(propA.getCoordinates(), axis);
                Interval intB = projectPointsOnAxis(propB.getCoordinates(), axis);
                if (intA.distance(intB) > 0)
                    result.Intersect = false;
            return result;
        public Interval projectPointsOnAxis(Vector2D[] points, Vector2D axis){
            Interval i = new Interval();
            for (Vector2D p: points)
                i.add(projectPointOnAxis(p, axis));
            return i;
        public float projectPointOnAxis(Vector2D point, Vector2D axis){
            // axis <-> y=a*x
            float a  = axis.y / axis.x;
            // line <-> y=(-a/1)*x+b
            float a2 = -axis.x / axis.y;
            // b = y-a2*x
            float b = point.y - a2*point.x;
            // y = a *x
            // y = a2*x + b
            // => a*x = a2*x + b
            float x = b/(a-a2);
            float y = a*x;
            // is there a better way to do this?
            return new Float(Math.sqrt(x*x + y*y)).floatValue();
         * Put all edges in 1 array, eliminate doubles (parallels).
        public Vector2D[] UniqueEdges(MovableProp propA,MovableProp propB){
            Vector2D[] aEdges = propA.getEdges();
            Vector2D[] bEdges = propB.getEdges();
            ArrayList<Vector2D> tmp = new ArrayList<Vector2D>();
            for (Vector2D v: aEdges){
                tmp.add(v);
            for (Vector2D v: bEdges){
               if (! tmp.contains(v))
                    tmp.add(v);
            return tmp.toArray(new Vector2D[tmp.size()]);
    }<h6>CollisionResult</h6>
    package CollsisionDetector;
    import World.Vector2D;
    public class CollisionResult {
        public boolean WillIntersect;
        public boolean Intersect;
        public Vector2D MinimumTranslationVector;
        public CollisionResult() {
    }<h6>Interval</h6>
    package CollsisionDetector;
    public class Interval {
        public float min;
        public float max;
        public Interval() {
            min = Float.MAX_VALUE;
            max = Float.MIN_VALUE;
        public void add(float f){
            // no 'else'! In an empty interval both will be true
            if (f>max)
                max = f;
            if (f<min)
                min = f;
        public float distance(Interval interval){
            if (this.min < interval.min) {
                return interval.min - this.min;
            } else {
                return this.min - interval.min;
    }_<h5>package World</h5>_
    <h6>MovableProp</h6>
    package World;
    public interface MovableProp {
        public int getNPoints();
        public Vector2D[] getEdges();
        public Vector2D[] getCoordinates();
    }<h6>Vector2D</h6>
    package World;
    public class Vector2D {
        public float x;
        public float y;
        public Vector2D(float x, float y) {
            this.x = x;
            this.y = y;
        public boolean equals(Object obj){
            if (!(obj instanceof Vector2D)){
                return false;
            }else
                return (this.x == ((Vector2D)obj).x && this.y == ((Vector2D)obj).y);
        public String toString() {
            return ("Vector2D  x=" + x + " ,  y=" + y);
        public void normalize(){
            if (x*x + y*y != 1){
                float x2 = x;
                x /= Math.sqrt(x2*x2+y*y);
                y /= Math.sqrt(x2*x2+y*y);
        public Vector2D getPerpendicular(){
            Vector2D per = new Vector2D(-y,x);
            per.normalize();
            return per;
    }_<h5>package Test</h5>_
    <h6>Test</h6>
    package Test;
    import CollsisionDetector.CollisionDetector;
    import World.MovableProp;
    import java.awt.Polygon;
    import java.util.ArrayList;
    import java.util.Vector;
    import javax.swing.JFrame;
    public class Test {
        public static void main(String args[]) {
            CollisionDetector detect = new CollisionDetector();
            float[] x = new float[3];
            float[] y = new float[3];
            ArrayList<MovableProp> list = new ArrayList<MovableProp>();
            x[0] = 200; x[1] = 300; x[2] = 500;
            y[0] = 400; y[1] = 200; y[2] = 300;
            list.add(new TestMovProp(x,y));
            x[0] = 300; x[1] = 500; x[2] = 600;
            y[0] = 400; y[1] = 400; y[2] = 500;
            list.add(new TestMovProp(x,y));
            x[0] = 200; x[1] = 300; x[2] = 600;
            y[0] = 600; y[1] = 400; y[2] = 500;
            list.add(new TestMovProp(x,y));
            x[0] = 100; x[1] = 200; x[2] = 300;
            y[0] = 800; y[1] = 500; y[2] = 700;
            list.add(new TestMovProp(x,y));
            x[0] = 600; x[1] = 600; x[2] = 700;
            y[0] = 400; y[1] = 700; y[2] = 500;
            list.add(new TestMovProp(x,y));
    //        x[0] = 100; x[1] = 001; x[2] = 900;
    //        y[0] = 001; y[1] = 900; y[2] = 500;
    //        list.add(new TestMovProp(x,y));
            x = new float[4];
            y = new float[4];
            x[0] = 450; x[1] = 550; x[2] = 500; x[3] = 400;
            y[0] = 200; y[1] = 250; y[2] = 650; y[3] = 600;
            list.add(new TestMovProp(x,y));
            int n = list.size();
            boolean[][] matrix = new boolean[n][n];
            for (int i=0; i<n; i++){
                for (int j=0; j<n; j++){
                    if (i!=j)
                    matrix[i][j] = detect.DetectCollision(list.get(i),list.get(j)).Intersect;
            System.out.print("  ");
            for (int i=0; i<n; i++){
                System.out.print("  " + (i+1));
            for (int i=0; i<n; i++){
                System.out.print("\n" + (i+1) + ":  ");
                for (int j=0; j<n; j++){
                    if (i==j)
                        System.out.print("-  ");
                    else if (matrix[i][j])
                        System.out.print("1  ");
                    else
                        System.out.print("0  ");
            System.out.println();
            JFrame window = new JFrame();
            window.setDefaultCloseOperation(window.EXIT_ON_CLOSE);
            window.pack();
            window.setVisible(true);
            window.setContentPane( new TestPanel(list));
            window.pack();
    }<h6>TestMovProp</h6>
    package Test;
    import World.MovableProp;
    import World.Vector2D;
    public class TestMovProp implements MovableProp{
        float[] X;
        float[] Y;
        Vector2D[] coor;
        public TestMovProp(float[] x, float[] y) {
            X=x; Y=y;
            coor = new Vector2D[getNPoints()];
            for(int i=0; i< getNPoints(); i++){
                coor[i] = new Vector2D(X, Y[i]);
    public Vector2D[] getCoordinates(){
    return coor;
    public int getNPoints() {
    return X.length;
    public Vector2D[] getEdges() {
    int n = getNPoints();
    Vector2D[] v = new Vector2D[n];
    for (int i=0; i<n-1; i++){
    v[i] = new Vector2D(X[i]-X[i+1], Y[i]-Y[i+1]);
    v[i].normalize();
    v[n-1] = new Vector2D(X[0]-X[n-1], Y[0]-Y[n-1]);
    v[n-1].normalize();
    return v;
    public String toString() {
    String s = "\n";
    for (Vector2D v: getCoordinates())
    s += ("\n" + v);
    return s;
    <h6>TestPanel</h6>package Test;
    import World.MovableProp;
    import World.Vector2D;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Polygon;
    import java.util.ArrayList;
    import javax.swing.JPanel;
    public class TestPanel extends JPanel {
    public ArrayList<MovableProp> list;
    public TestPanel(ArrayList<MovableProp> list) {
    super();
    this.list = list;
    setPreferredSize(new Dimension(1000,850));
    public void paint(Graphics g) {
    super.paint(g);
    for (MovableProp prop:list){
    Vector2D[] coor = prop.getCoordinates();
    int n = prop.getNPoints();
    g.drawLine((int)coor[0].x, (int)coor[0].y, (int)coor[n-1].x, (int)coor[n-1].y);
    for (int i=0; i<n-1; i++){
    g.drawLine((int)coor[i].x, (int)coor[i].y, (int)coor[i+1].x, (int)coor[i+1].y);

    .java wrote:
    I have been search for what seems like hours, Nice try, but in less than 15 seconds I found a complete discussion on the subject.
    and I still have not managed to find anybody or anything that can clearly answer these three questions:
    1. What is SAT?
    2. How does it apply to 2D collision detection? (How would it be different with 3D collision detection?)
    3. How can this be implemented in Java using Shape objects?
    Note: I am easily confused by geometric terminology.This really looks like a question you should have an answer for in your notes from class, or in your book. If not perhaps you need to go ask your teacher what it is and explain why you don't have it in your notes or book.

  • Cs6 3D axis widget showing up blurry/fuzzy

    My 3D axis widget was showing fine( solid, clear, and visible in front of the mesh I was working on), but now It has started to switch between normal and Blurry/Fuzzy( as if it is sitting behind the mesh and the whole scene). It is very difficult to see sometimes and even more s to access it. Does anyone know of this problem,  and if so, how t correct it? Also any troubleshooting advice would be helpful too.
    Sys info:
    Adobe Photoshop Version: 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00) x64
    Operating System: Windows NT
    Version: 6.2
    System architecture: Intel CPU Family:6, Model:5, Stepping:5 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2, HyperThreading
    Physical processor count: 2
    Logical processor count: 4
    Processor speed: 2394 MHz
    Built-in memory: 7989 MB
    Free memory: 4517 MB
    Memory available to Photoshop: 7040 MB
    Memory used by Photoshop: 88 %
    Image tile size: 128K
    Image cache levels: 4
    OpenGL Drawing: Enabled.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: True.
    OpenGL Allow Old GPUs: Not Detected.
    Video Card Vendor: Intel
    Video Card Renderer: Intel(R) HD Graphics
    Display: 1
    Display Bounds:=  top: 0, left: 0, bottom: 768, right: 1280
    Video Card Number: 1
    Video Card: Intel(R) HD Graphics
    OpenCL Unavailable
    Driver Version: 8.15.10.2858
    Driver Date: 20121009000000.000000-000
    Video Card Driver: igdumd64.dll,igd10umd64.dll,igdumdx32,igd10umd32
    Video Mode:
    Video Card Caption: Intel(R) HD Graphics
    Video Card Memory: 3770 MB
    Video Rect Texture Size: 8192
    Serial number: Tryout Version
    Application folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\
    Temporary file path: C:\Users\RYANS_~1\AppData\Local\Temp\
    Photoshop scratch has async I/O enabled
    Scratch volume(s):
      C:\, 341.9G, 82.7G free
    Required Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Required\
    Primary Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Plug-ins\
    Additional Plug-ins folder: not set
    Installed components:
       A3DLIBS.dll   A3DLIB Dynamic Link Library   9.2.0.112  
       ACE.dll   ACE 2012/06/05-15:16:32   66.507768   66.507768
       adbeape.dll   Adobe APE 2012/01/25-10:04:55   66.1025012   66.1025012
       AdobeLinguistic.dll   Adobe Linguisitc Library   6.0.0  
       AdobeOwl.dll   Adobe Owl 2012/06/26-12:17:19   4.0.95   66.510504
       AdobePDFL.dll   PDFL 2011/12/12-16:12:37   66.419471   66.419471
       AdobePIP.dll   Adobe Product Improvement Program   6.0.0.1654  
       AdobeXMP.dll   Adobe XMP Core 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPFiles.dll   Adobe XMP Files 2012/02/06-14:56:27   66.145661   66.145661
       AdobeXMPScript.dll   Adobe XMP Script 2012/02/06-14:56:27   66.145661   66.145661
       adobe_caps.dll   Adobe CAPS   6,0,29,0  
       AGM.dll   AGM 2012/06/05-15:16:32   66.507768   66.507768
       ahclient.dll    AdobeHelp Dynamic Link Library   1,7,0,56  
       aif_core.dll   AIF   3.0   62.490293
       aif_ocl.dll   AIF   3.0   62.490293
       aif_ogl.dll   AIF   3.0   62.490293
       amtlib.dll   AMTLib (64 Bit)   6.0.0.75 (BuildVersion: 6.0; BuildDate: Mon Jan 16 2012 18:00:00)   1.000000
       ARE.dll   ARE 2012/06/05-15:16:32   66.507768   66.507768
       AXE8SharedExpat.dll   AXE8SharedExpat 2011/12/16-15:10:49   66.26830   66.26830
       AXEDOMCore.dll   AXEDOMCore 2011/12/16-15:10:49   66.26830   66.26830
       Bib.dll   BIB 2012/06/05-15:16:32   66.507768   66.507768
       BIBUtils.dll   BIBUtils 2012/06/05-15:16:32   66.507768   66.507768
       boost_date_time.dll   DVA Product   6.0.0  
       boost_signals.dll   DVA Product   6.0.0  
       boost_system.dll   DVA Product   6.0.0  
       boost_threads.dll   DVA Product   6.0.0  
       cg.dll   NVIDIA Cg Runtime   3.0.00007  
       cgGL.dll   NVIDIA Cg Runtime   3.0.00007  
       CIT.dll   Adobe CIT   2.0.5.19287   2.0.5.19287
       CoolType.dll   CoolType 2012/06/05-15:16:32   66.507768   66.507768
       data_flow.dll   AIF   3.0   62.490293
       dvaaudiodevice.dll   DVA Product   6.0.0  
       dvacore.dll   DVA Product   6.0.0  
       dvamarshal.dll   DVA Product   6.0.0  
       dvamediatypes.dll   DVA Product   6.0.0  
       dvaplayer.dll   DVA Product   6.0.0  
       dvatransport.dll   DVA Product   6.0.0  
       dvaunittesting.dll   DVA Product   6.0.0  
       dynamiclink.dll   DVA Product   6.0.0  
       ExtendScript.dll   ExtendScript 2011/12/14-15:08:46   66.490082   66.490082
       FileInfo.dll   Adobe XMP FileInfo 2012/01/17-15:11:19   66.145433   66.145433
       filter_graph.dll   AIF   3.0   62.490293
       hydra_filters.dll   AIF   3.0   62.490293
       icucnv40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       icudt40.dll   International Components for Unicode 2011/11/15-16:30:22    Build gtlib_3.0.16615  
       image_compiler.dll   AIF   3.0   62.490293
       image_flow.dll   AIF   3.0   62.490293
       image_runtime.dll   AIF   3.0   62.490293
       JP2KLib.dll   JP2KLib 2011/12/12-16:12:37   66.236923   66.236923
       libifcoremd.dll   Intel(r) Visual Fortran Compiler   10.0 (Update A)  
       libmmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   10.0  
       LogSession.dll   LogSession   2.1.2.1640  
       mediacoreif.dll   DVA Product   6.0.0  
       MPS.dll   MPS 2012/02/03-10:33:13   66.495174   66.495174
       msvcm80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6910  
       msvcm90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcp100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcp80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6910  
       msvcp90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       msvcr100.dll   Microsoft® Visual Studio® 2010   10.00.40219.1  
       msvcr80.dll   Microsoft® Visual Studio® 2005   8.00.50727.6910  
       msvcr90.dll   Microsoft® Visual Studio® 2008   9.00.30729.1  
       pdfsettings.dll   Adobe PDFSettings   1.04  
       Photoshop.dll   Adobe Photoshop CS6   CS6  
       Plugin.dll   Adobe Photoshop CS6   CS6  
       PlugPlug.dll   Adobe(R) CSXS PlugPlug Standard Dll (64 bit)   3.0.0.383  
       PSArt.dll   Adobe Photoshop CS6   CS6  
       PSViews.dll   Adobe Photoshop CS6   CS6  
       SCCore.dll   ScCore 2011/12/14-15:08:46   66.490082   66.490082
       ScriptUIFlex.dll   ScriptUIFlex 2011/12/14-15:08:46   66.490082   66.490082
       tbb.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       tbbmalloc.dll   Intel(R) Threading Building Blocks for Windows   3, 0, 2010, 0406  
       TfFontMgr.dll   FontMgr   9.3.0.113  
       TfKernel.dll   Kernel   9.3.0.113  
       TFKGEOM.dll   Kernel Geom   9.3.0.113  
       TFUGEOM.dll   Adobe, UGeom©   9.3.0.113  
       updaternotifications.dll   Adobe Updater Notifications Library   6.0.0.24 (BuildVersion: 1.0; BuildDate: BUILDDATETIME)   6.0.0.24
       WRServices.dll   WRServices Friday January 27 2012 13:22:12   Build 0.17112   0.17112
       wu3d.dll   U3D Writer   9.3.0.113  
    Required plug-ins:
       3D Studio 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Accented Edges 13.0
       Adaptive Wide Angle 13.0
       ADM 3.11x01
       Angled Strokes 13.0
       Average 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Bas Relief 13.0
       BMP 13.0
       Camera Raw 7.3
       Chalk & Charcoal 13.0
       Charcoal 13.0
       Chrome 13.0
       Cineon 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Clouds 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Collada 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Color Halftone 13.0
       Colored Pencil 13.0
       CompuServe GIF 13.0
       Conté Crayon 13.0
       Craquelure 13.0
       Crop and Straighten Photos 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Crop and Straighten Photos Filter 13.0
       Crosshatch 13.0
       Crystallize 13.0
       Cutout 13.0
       Dark Strokes 13.0
       De-Interlace 13.0
       Dicom 13.0
       Difference Clouds 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Diffuse Glow 13.0
       Displace 13.0
       Dry Brush 13.0
       Eazel Acquire 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Embed Watermark 4.0
       Entropy 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Extrude 13.0
       FastCore Routines 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Fibers 13.0
       Film Grain 13.0
       Filter Gallery 13.0
       Flash 3D 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Fresco 13.0
       Glass 13.0
       Glowing Edges 13.0
       Google Earth 4 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Grain 13.0
       Graphic Pen 13.0
       Halftone Pattern 13.0
       HDRMergeUI 13.0
       IFF Format 13.0
       Ink Outlines 13.0
       JPEG 2000 13.0
       Kurtosis 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Lens Blur 13.0
       Lens Correction 13.0
       Lens Flare 13.0
       Liquify 13.0
       Matlab Operation 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Maximum 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Mean 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Measurement Core 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Median 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Mezzotint 13.0
       Minimum 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       MMXCore Routines 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Mosaic Tiles 13.0
       Multiprocessor Support 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Neon Glow 13.0
       Note Paper 13.0
       NTSC Colors 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Ocean Ripple 13.0
       Oil Paint 13.0
       OpenEXR 13.0
       Paint Daubs 13.0
       Palette Knife 13.0
       Patchwork 13.0
       Paths to Illustrator 13.0
       PCX 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Photocopy 13.0
       Photoshop 3D Engine 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Picture Package Filter 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Pinch 13.0
       Pixar 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Plaster 13.0
       Plastic Wrap 13.0
       PNG 13.0
       Pointillize 13.0
       Polar Coordinates 13.0
       Portable Bit Map 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Poster Edges 13.0
       Radial Blur 13.0
       Radiance 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Range 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Read Watermark 4.0
       Reticulation 13.0
       Ripple 13.0
       Rough Pastels 13.0
       Save for Web 13.0
       ScriptingSupport 13.0.1
       Shear 13.0
       Skewness 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Smart Blur 13.0
       Smudge Stick 13.0
       Solarize 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Spatter 13.0
       Spherize 13.0
       Sponge 13.0
       Sprayed Strokes 13.0
       Stained Glass 13.0
       Stamp 13.0
       Standard Deviation 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Sumi-e 13.0
       Summation 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Targa 13.0
       Texturizer 13.0
       Tiles 13.0
       Torn Edges 13.0
       Twirl 13.0
       U3D 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Underpainting 13.0
       Vanishing Point 13.0
       Variance 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Variations 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Water Paper 13.0
       Watercolor 13.0
       Wave 13.0
       Wavefront|OBJ 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       WIA Support 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       Wind 13.0
       Wireless Bitmap 13.0.1 (13.0.1 20120808.r.519 2012/08/08:21:00:00)
       ZigZag 13.0
    Optional and third party plug-ins: NONE
    Plug-ins that failed to load: NONE
    Flash: NONE
    Installed TWAIN devices: NONE

    You probably have updated/ changed something in the driver. Undo those changes and everything will be back to normal. Otehr than that you could be working at a document size you haven't worked before or invoked some setting or tool you never used before that may trigger the behavior because it's beyond your graphics chip's limited capabilities...
    Mylenium

  • How do I plot a y axis on the left and right in DIAdem/VIEW (version 11.0)?

    I am trying to analyze flight data, and I would like to analyze plots of certain parameters so that they share an x axis. It is necessary to view these using two different y axis, on the left and right. How do I do this in DIAdem (version 11.0) in the VIEW tab? Is this possible to do in the VIEW tab?

    myocom,
    You can highlight random points in DIAdem as well. 
    Here is an example:
    Use the cursor to move to the point you wish to highlight.
    Press the "Set Data Point and Flag" icon on each data point you wish to highlight
    When you are done selecting points, press the "Flags: Copy Data Points" icon - that will copy all X/Y coordinates into two new channels
    I created a REPORT Layout using the original data and the highlighted random points (I added the actual point Z-value above the point, they look strange when written at the exact point). I attached the layout for your reference.
    The complete task took 3 minutes from loading the data to finishing and exporting the REPORT layout. If you have a REPORT layout already, this will take less than 30 seconds ...
    I am not familiar with Matlab, so I can't compare how this works in DIAdem vs. Matlab. You can add the combine the complete process in a Script and it will automatically create this kind of report after simply selecting a few data points in VIEW and then pressing a button ...
        Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."
    Attachments:
    Report with highlights.zip ‏5 KB

  • 3D Rotating on it's own center axis problem...

    Need some help here. This is my first time using 3D in flash.
    I have a movieclip (picture 80 x 80 pix) that I am tweening to look like it is rotating like face of a cube.
    What I did:
    1. I transformed the z-axis to "raise" the picture off of the y axis.
    2. Then I rotated it around the y-axis from one end of my tween to the other.
    Looks great when I scroll through the movie clip's time line but (starts on right almost paper thing, rotates to center square, and continues to the left again paper thin) The problem is when I place it on the stage and preview the swf, it rotates around its own center point and not the offset y-axis.
    If I convert it to frame by frame animation, it works but I don't want to do that.
    Please advise someone.
    Thanks!

    Sorry if I don't' quite get it, but my other thread was about the movieclip defaulting to the stages coordinates. In this case my movieclip's animation is rotating around the symbols center point and not around the y-axis as I would like.
    I can move the transform the symbol from axis point to another and it is fine but in this case i am only rotating it but after I placed is away from the y-axies. I expect it to "orbit" around the y axis continually facing it...and it does when I move through the tweaned frames, but when I publish the swf, it no longer "orbits" around the y-axis but rather just spins around it's center point.
    I hope this is a little clearer, and thanks for your other answer. I'll plug that code in as soon as I can.

  • Can You Change 3D Object Rotation Axis?

    Greetings. I have created a 3d object using repousse in Photoshop (CS5 extended). The original 2d image was created in Illustrator. I have found that in both Photoshop and After Effects, when I rotate this object in 3D space, either rotating the object itself or the camera, that the axis upon which it rotates is not the 3D center of the 3D object, but rather somewhere behind it. The result is that it is rotating like the moon rotates around the earth, rather than rotating in place, like an eye moving (rotating) in an eye socket; i want the eye ball to stay in one place, but see the pupil move up and down and all around like a real eye would.
    I have had no luck changing anchor points or positions of the object, even though I do have the X, Y, Z coordinates to manipulate.
    Can you tell me how to adjust this anchor point, or rotation axis point, or whatever this would be called?
    Thanks.

    Not really true...
    Yes it is limited but it can be altered.
    I believe that photoshops 3d center point is based on the world center and not the objects center. This means that it is possibloe to move the object to the world center to fix the rotation of your object.
    Open window>3d panel and just below the layers in that panel are some icon at the left side of the panel. Third icon down is the mesh tool, hold down the mouse button to bring up the pop up menu. Select the slide mesh tool. This will let you move the mesh adjust the pivot point.
    The problem that I see with this, is that it is trial by error, I do not see away to visually see where the world center is.
    Scratch that, at the bottom of the panel are three icons. The left of the three will turn on the ground plane. The plane does show world center.(where the red and green lines intersect is world zero)
    To understand which axis is which, sinse it does not specify.  Select the 3d pan tool, then in the top tool bar, type in a value one axis at a time to see which direction the object is moving. Then repeat the process for the rotate tool and see how the object rotates around each axis.

  • Where is original point of Z axis in a stereo vision system?

    Hello, everyone
    I use LabVIEW Stereo Vision module. After I calibrate my stereo vision system, I want to verify the accuracy of my system. I can get every point`s depth in my picture, but where is my original point of Z axis? 
    In the newest NI Vision Concepts Help, it is written that  NI Vision renders 3D information with respect to the left rectified image such that the new optical center will be at (0, 0, Z) position. Is the original point of Z axis is on the CCD of left camera or the optical center of my left camera`s lens?
    So anyone can help me ?
    CLAD
    CAU
    Solved!
    Go to Solution.
    Attachments:
    未命名.jpg ‏63 KB

    Hello,
    I would say that the coordinate system origin is at the optical centre, that is the camera's projection centre.
    So, yes, the optical centre of the left camera's lense. This seems most logical to me...
    Best regards,
    K
    https://decibel.ni.com/content/blogs/kl3m3n
    "Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

  • Cursors track on 4 2D displays in VIEW - but how do I get Coordinates to display for each instead of just the active display

    If DIADEM goes to the trouble of tracking the cursor on all the pages in a sheet I would think there is a NON-SCRIPT way to show the Y values for all. 
    My graphs are aligned on the X-axis (torque), 4 - 2D displays(1 each for RPM, HP, Current and Efficiency), and 10 plots on each of the 4 displays all in DIADEM 2010.
    The display coordinates box only shows active display and others are grayed out.  I've played around with the "Cursor Parameters" but that yields the same although what I add does show in the "Coordinates" dialog.  I assume it may have something to do with making it automatic but I see no way to change it and how do I assign it to a channel???
    On another note I'd like to be able to synchronize all 4 charts to be on the same plot(legend) to the above tracking and thus will read the same relevant data.  So if  plot 1 is selected on the RPM display then the other three will also be on plot 1.  I assume this would have to be done programmatically but if not I'm all ears.
    Solved!
    Go to Solution.
    Attachments:
    cursortracker.docx ‏284 KB

    Hi Tweedy -
    No, you can't use the .NET code directly in DIAdem.  I'm not sure what the point in suggesting it was, as it would take significant modification to be able to use similar code in DIAdem.
    Have you tried using the VIEW Legends?  Expand the legend for each graph and then double-click on the legend, at which point you can configure what information shows up about each curve.  By default, the legend will show the Curve Name, Curve Units, X-Position (of the cursor), and Y-Position (of the cursor).  Feel free to augment or contract this as needed for your preference.
    After expanding each legend, switch to the Curve Cursor, and you should be able to see the Y-Position of each curve, completely synchronized.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • How to get coordinates of components. PLEASE HELP ME URGENT!

    Hi, I am trying to get the coordinates of my components that are tabbed pane buttons, buttons, text fields etc so I can place an image of a pointer under it that points to it and then under the image of the pointer I would put a label describing the button for example "press the tab to start". Then when I press tab1 the image of pointer image points to the next component and has a label under pointer.
    Now I have tried using componenet.getX() and getY() and then set the values of the the image panel to use then the label panel so they be placed under the component, these panels are not using layout manager but absolute positioning. If the window is resized then the labels and image of pointer should also adjust. I have tried putting the label and arrow into a glasspane and now layerdpane as some people here suggested which when I do then add it to contentpane the main panel with the components is not there but the layerd pane is.
    I am having huge difficulties with this and if someone can Please just tell me or even better give me an example code how to find out the coordinates of components so I can place my image of pointers and labels underneath them I will be very grateful of you. I am on a verge of giving up accomplish what I am doing and I am new to the swing framework. My progress to solve this has been very slow and frustrating. I just hope someone here can help.

    I tried the both of codes given. But the code given by both the person i have not understand. And what they there code is doing. This is the code form my side if this example help u.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    * Author Waheed-Ul-Haq ( BS(CS)-8 )
    public class Samulation2
         JPanel pane;
         JLabel label1;
         JTextField entProcesfld;
         JButton buttCreat;
         JButton buttReslt;
         JLabel usrProcesID[];
         JTextField usrArivTam[];
         int processes;
         public JComponent createComponents()
         pane = new JPanel();
         pane.setLayout (null);     
         label1 = new JLabel();     //Label for to tell user to enter no of Processes.
         label1.setText("Enter the no. of Processes");
         pane.add(label1);
         label1.setBounds(20, 25, 150, label1.getPreferredSize().height);
         entProcesfld = new JTextField();     //TextField to enter no of processes.
         entProcesfld.setToolTipText("Enter the no of Processes.");
         pane.add(entProcesfld);
         entProcesfld.setBounds(180, 25, 100, entProcesfld.getPreferredSize().height);
         buttCreat = new JButton();          //Button to create the TextFields.
         buttCreat.setText("Create TextFields");
         pane.add(buttCreat);               //Adding cutton to Jpane.
         buttCreat.setBounds(new Rectangle(new Point(30, 60), buttCreat.getPreferredSize()));
         buttCreat.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        buttCreatActionPerformed(e);
                   } } );          //ActionListenr to Create the TextFields.
         pane.setPreferredSize(new Dimension(600,600));
         return pane;
         }     //-------END of Component createComponents()--------//
         private void buttCreatActionPerformed(ActionEvent e)     //Action to Create the TextFields.
                   processes = Integer.parseInt (entProcesfld.getText ());
                   JLabel Labproces = new JLabel();     //Label of Processes.
                   Labproces.setText("Processes");
                   pane.add(Labproces);
                   Labproces.setBounds(new Rectangle(new Point(15, 105), Labproces.getPreferredSize()));
                   JLabel labArivTam = new JLabel();     //Label of Arival time.
                   labArivTam.setText("Arrial Time");
                   pane.add(labArivTam);
                   labArivTam.setBounds(new Rectangle(new Point(90, 105), labArivTam.getPreferredSize()));
                   //----Creating Dynamic JLabels------//
                   usrProcesID  = new JLabel[processes];     /* Makes an array */
                   int yXis = 125;          //Variable for Y-axix of JLabel.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
                    usrProcesID[i] = new JLabel("P" + i);      /* Makes a JLabel at an array place */
                    pane.add(usrProcesID);      /* Adds a JLabel (rather than an array) */
    usrProcesID[i].setBounds(new Rectangle(new Point(28, yXis), usrProcesID[i].getPreferredSize()));
    yXis = yXis + 25;     /* Increses the Y-axis to show JLabels. */
    }     //EndFor     
    //-------End Dynamic JLabels---------//               
                   //-----Creating Dynamic Arival Time TextFields-----//
                   usrArivTam = new JTextField[processes];          /* Makes an array */
                   yXis = 125;          //Variable for Y-axix of JTextField.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
    usrArivTam[i] = new JTextField();     /* Makes a JTextField at an array place */
    usrArivTam[i].setToolTipText("Enter Arival Time.");
    pane.add(usrArivTam[i]);      /* Adds a JTestField (rather than an array) */
    usrArivTam[i].setBounds(100, yXis, 35, usrArivTam[i].getPreferredSize().height);
    yXis = yXis + 25;     /* Increses the Y-axis to show JTextFields. */
    }     //EndFor     
    //-----End Dynamic Arival Time TextFields.-----//
    //----Calculating points for Label and textfields.
    Point poi = new Point();
    poi = usrArivTam[processes-1].getLocation ();     //Getting the location of the last text field of ArivalTime.
    //-----Label for Average Waiting time.--------\\
    JLabel averWaitLB = new JLabel();
    averWaitLB.setText("Average Waiting Time");
              pane.add(averWaitLB);
              averWaitLB.setBounds(new Rectangle(new Point(30, (int)poi.getY()+50), averWaitLB.getPreferredSize()));
    //-----TextField for Average Waiting Time.--------\\
    JTextField averWaitTF = new JTextField();
    averWaitTF.setText ("Hello");
    averWaitTF.setEditable(false);
    pane.add (averWaitTF);
    averWaitTF.setBounds(190, (int)poi.getY()+50, 35, averWaitTF.getPreferredSize().height);
    }     //------END of void buttResltActionPerformed(ActionEvent e)---------//
         private static void createAndShowGUI()
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Priority Scheduling (Non-Preemptive)....");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Samulation2 application = new Samulation2();
    //Create and set up the content pane.
    JComponent components = application.createComponents ();
    components.setOpaque (true);
    int vertSB = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
              int horzSB = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
              JScrollPane scrollPane = new JScrollPane(components, vertSB, horzSB);
    scrollPane.setPreferredSize (new Dimension(720,455));
    frame.getContentPane ().add (scrollPane,null);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    }     //------END Of void createAndShowGUI()--------//
         public static void main(String[] args)
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
         }     //---------End of main()----------------//
    }     //--------END of class Samulation2----------//
    If any body help me implementing the ScrollBars in this code. I am unable to use Scroll Bars with this code while using NULL layout. If any body tell me how to get the Size and set for the pane.

Maybe you are looking for

  • My iPad no longer detects my memory card reader to transfer photos from my camera?

    My iPad is no longer detecting my apple memory card reader to transfer photos from my camera to my iPad 2

  • Boot failure with AMD core unlock *solved*

    Before you criticize me for buying a triple core instead of a quad core, I want you to know that my situation seems to only conflict with Arch. I have an AMD Athlon II x3.  If I unlock the 4th core, Linux live CDs boot up just fine, Windows XP boots

  • Message_type_x error in mr11

    hi gurus , i am getting a message_type_x error in mr11 in the following code in the function module 'CKMLGRIR_POST_GRIR_MAINTAIN i have commented the line which throws run time error FORM CHECK_ACTIVITY_TAB_POST. Pflegen der Tabelle ACTIVITY_TAB   CL

  • Viewing Images in iWeb

    I apologize in advance if this has been asked before but I cannot find an answer to my problem anywhere! I have several graphic images that I want to showcase on one of my iWeb pages. What I would like to have is a series of smaller square "icons" at

  • [DW]No me deja poner en el font pixeles

    Hola tengo una web e intento poner un tamaño de texto en pixeles y me coge puntos lo que hago es lo siguiente: <font face="Verdana, Arial, Helvetica, sans-serif" size="13px">