I want to create a border...

but it is not working!!!!!!! I want to create a border around a box. What I have done is create 2 separate transform groups one with the filled boxes and another with lines. The border works fine if it is just around one box in any position but when it is placed around a group of boxes it doesn't work! Consider the board a boardgame board... there have to be borders around the boxes so that the users can know where a square ends and begins spent all day on this today... didn't think that something so simple would be so difficult!! Thank you in advance for helping! Below is the code
//This is the code for creating the squares
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.image.TextureLoader;
public class Square
     public static final float LENGTH = (float)0.05;
     public static final float DEPTH = (float)0.0125;
     public int column;
     public int row;
     public float x;
     public float y;
     public float z;
     private TransformGroup trans;
     private TransformGroup blackLines;
     private Box square;
     private Box lineSquare;
     private Group subGroup;
     private Group lineGroup;
     public Square(Texture boardpic, int column, int row)
          this.column = column;
          this.row = row;
          subGroup = new BranchGroup();
          lineGroup = new BranchGroup();
          Color3f grey = new Color3f(0.5f,0.5f,0.5f);
          Color3f black = new Color3f(1.0f,1.0f,1.0f);
     Transform3D t = new Transform3D( );
          float distanceToEdge = ( LENGTH * (float)4.0 ) - ( LENGTH / (float)2.0 );
          //System.out.println(distanceToEdge);
          trans= new TransformGroup();
          blackLines = new TransformGroup();
          x = -distanceToEdge + ( column * LENGTH ) ;
     y = distanceToEdge - ( row * LENGTH ) ;
          z = -DEPTH;
Vector3f v = new Vector3f(x, y, z);
          t.setTranslation(v);
          trans.setTransform(t);
          trans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
          trans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
          blackLines.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
          blackLines.setTransform(t);
          //sets a black line around a square                    
          Appearance blackLineApp = new Appearance();
          blackLineApp.setColoringAttributes(new ColoringAttributes(black,ColoringAttributes.NICEST));
          PolygonAttributes blPolyAt=new PolygonAttributes(PolygonAttributes.POLYGON_LINE,
                                        PolygonAttributes.CULL_FRONT,0f);
          //blPolyAt.setPolygonOffset(100.0f);
          //blPolyAt.setPolygonOffsetFactor(100.0f);
          blackLineApp.setPolygonAttributes(blPolyAt);
          lineSquare = new Box((LENGTH / 2.0f), (LENGTH / 2.0f), DEPTH, blackLineApp);
          subGroup.addChild(lineSquare);
          //Attributes for creating the filled box
          Appearance appearance = new Appearance();
          PolygonAttributes polyAt=new PolygonAttributes(PolygonAttributes.POLYGON_FILL,
                                        PolygonAttributes.CULL_NONE,0f);
          polyAt.setPolygonOffset(0.1f);
          polyAt.setPolygonOffsetFactor(0.1f);
          appearance.setPolygonAttributes(polyAt);
          appearance.setColoringAttributes(new ColoringAttributes(grey,ColoringAttributes.NICEST));
          appearance.setTexture(boardpic);
          TextureAttributes texAttr = new TextureAttributes();
          texAttr.setTextureMode(TextureAttributes.MODULATE);
          appearance.setTextureAttributes(texAttr);     
          Box square = new com.sun.j3d.utils.geometry.Box((LENGTH / 2.0f), (LENGTH / 2.0f), DEPTH, appearance);
          trans.addChild(square);
          subGroup.addChild(trans);
          subGroup.addChild(blackLines);
     public Group getGroup()
          return subGroup;
     public Group getLines()
          return lineGroup;
//this the code for creating the board
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.GraphicsConfiguration;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.image.TextureLoader;
public class Board extends JFrame
     public Square[][] fullBoard = new Square[23][23];
     public Board()
          GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
          Canvas3D c = new Canvas3D(config);
          BranchGroup bg = new BranchGroup();
          TextureLoader picload = new TextureLoader("brown001.gif", this);
          Texture texture = picload.getTexture();
          texture.setMagFilter(Texture.BASE_LEVEL_LINEAR | Texture.NICEST);
          texture.setMinFilter(Texture.BASE_LEVEL_LINEAR | Texture.NICEST);
          for(int col = 1; col < 23; col++)
               for (int row = 1; row < 23; row++)
                    fullBoard[col][row]=new Square(texture, (col-11), (row-11));
                    bg.addChild(fullBoard[col][row].getGroup());
                    //bg.addChild(fullBoard[col][row].getLines());
          TransformGroup tg = new TransformGroup();
          tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
          Transform3D rotation = new Transform3D();
          rotation.rotX(java.lang.Math.toRadians( -45 ));
          tg.setTransform(rotation);
          tg.addChild(bg);
          BranchGroup scene = new BranchGroup();
          scene.addChild(tg);
          scene.compile();
          SimpleUniverse u = new SimpleUniverse();
          u.getViewingPlatform().setNominalViewingTransform();
          u.addBranchGraph(scene);
          System.out.println("I am here now");
     public static void main (String [] args)
          Board b = new Board();
Thanks again...
-JET-

Sorry the line:
subGroup.addChild(lineSquare);
should read:
blackLines.addChild(lineSquare);

Similar Messages

  • Creating a border around objects?

    This should be simple but as a human being I'm useless and I can't figure it out
    I want to create a border around images like the triangles on
    this website.
    http://www.htmlandcssbook.com/code-samples/chapter-15/example.html
    Baby steps please, as I said I'm an invalid

    I'm 73 you will get that math soon hopefully you also get to 73 some day take your time. By 15 I had to take it in school.
    Equilateral triangle have three equal length sides and all three angle are 60degree  only these will expand with equal size borders added on the three sides.. Some triangle will expand with two equal size borders other all the borders will be different sizes. Symmetric things like squares and circles expand evenly.
    Equilateral triangle:
    You may find this helpful http://www.mathsisfun.com/geometry/symmetry-line-plane-shapes.html

  • Creating a border in a poster

    I want to create a border for a poster I'm making. I put a white rectangle on the poster. I tried to put another rectangle, smaller, in the center to create a transparent area so that just the "border" remained. I can't seem to get the inner rectangle to turn transparent.
    Recommendations are appreciated.
    Thanks.

    Well you want the layer to be transparent. Double click on the background name, a dialog will appear m saying new layer. Rename it frame
    Draw the marquis for the opening rectangle witht he marquis tool
    Hit delete
    you will now see the transparency grid.
    Now you can place as many images on different layers below it so you can reposition them t your liking.
    You can turn one on at a time.
    I assume you want to use more than one image there are other ways if you want different size borders for different sizes images.
    Here is a screen shot of the result.

  • Using Images to create a border in CS3

    Hello people,
    I've recenty, found that CSS3 is capable of creating cutom border styles by using your own images. I know that CSS3 is included with Adobe CS5 Dreamweaver, but I only have CS3. What I wanted to know is if there was an alternate method in CS3 that looks like a border, but is just an image.
    I know it is possible using a background image and stretching it, but was simply wondering if there is a more correct way.
    Thanks in advance.

    You can achieve some interesting results with regular CSS borders.  
    And CSS3 Box-shadows & Border-Radius.
    http://alt-web.com/TEMPLATES/2-image-web-design.shtml
    Or the old method with image slices.
    http://alt-web.com/DEMOS/Image-slices-in-a-CSS-based-layout.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How do you create a border around text?

    how do you create a border around text?

    Can you be a little more specific about what you are trying to do and the application that you want to use? The methods can vary depending on the application and who published it. For instance, if you're using Final Cut Pro here is a discussion describing how the border can be created.
    https://discussions.apple.com/thread/1470384?start=15&tstart=0
    If you are using an Apple branded application you can also post in the specific forums for those applications in order to help ensure a complete response.
    https://discussions.apple.com/community/ilife
    https://discussions.apple.com/community/iwork
    https://discussions.apple.com/community/professional_applications

  • When one or more family members who have been sharing one iTunes account wants to create their own iTunes account can they each upload the music/apps from the shared iTunes on their devices to the new iTunes account?

    When one or more family members who have been sharing one iTunes account wants to create their own iTunes account can they each upload the music/apps from the shared iTunes on their devices to the new iTunes account? 

    Yes. I would clarify your statement about the "shared" iTunes Library though. If you want each iOS device to have its own music library, you should create separate user accounts for them. Read:
    iTunes: How to share music between different accounts on a single computer
    How to use multiple iPods, iPads, or iPhones with one computer

  • My friend wanted to create a new iCloud account that was different to  her iTunes and app one when she deleted her iCloud account that was the same as her iTunes it won't let her log into her iTunes one now

    My friend wanted to create a new iCloud account that was different to  her iTunes and app one when she deleted her iCloud account that was the same as her iTunes it won't let her log into her iTunes one now what can I do to fix it she has paid or apps and songs and of she makes another account everything will be lost.
    Need help please :) thanks

    Ah thanks Razmee however there is NO option to delete the iCloud account in settings!

  • How do I create a new account for an iPod that is on an existing account?  My brother and I have shared an account for five years, and now that I'm moving out, I want to create my own account but still want to be able to play the music I've purchased.

    My brother and I have shared an account for five years, and now that I'm moving out, I want to create my own separate account but still want to be able to play the music I've purchased over five years. 

    In order to continue to play and sync the music you purchased with your old account, you'll need to authorize your new computer/iTunes library to do so.  You can do this by choosing Store -> Authorize This Computer and then entering in your old account credentials.
    That's all you should need to.  Then just create your own account and start purchasing and using it the same you have with the old one.
    B-rock

  • Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...?

    Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...? I have already added the music videos to my iphone so that is not the problem.... i cant seem to figure out how to make a playlist for them... IE: to make the videos play consecutively in the order i want without stopping after each video and gong back to the list.... this is what i have had to resort to make it work....what i want to do....is be able to make a playlist of videos on my iphone 5....take my apple tv to friends houses and with wifi....set up apple tv and play videos at the party and not have to stand by with the remote and find a new video to play stopping the music between the songs/videos....very annoying....and have spent over 4 hours one day and an hour and a half today on the phone today with a sr. advisor with apple and they have no clue.... this seems sooooo simple.... please somebody that really knows how to do this....i will be indebted forever...............
    Mike

    Thank you for replying.    Yes I deleted the old email address..   

  • I cannot sign in.  "This Apple ID has not yet been used with the iTunes Store.  Please review your account information."  I click "Review", next message "You must turn on cookies to continue.   Cookies must be enabled if you want to create or edit.. etc."

    I applied and received an upgrade code to Redeem Mountain Lion for my new MBP. 
    I get this message when I try to Sign in to the App Store after entering the redemption content code, and also if I just try to "Sign In".   The first part of the error is true - I haven't used the AppleID with the iTunes store.  
    I received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
    I also tried to re-create this appleID...(it was one suggestion I saw for this issue) It doesn't let me since the ID already exists...
    The error is:
    "This Apple ID has not yet been used with the iTunes Store.  Please review your account information."  I click "Review", next message "You must turn on cookies to continue.   Cookies must be enabled if you want to create or edit.. etc." 
    It's clearly not a cookie issue..   Stuck...

    The first part of the error is true - I haven't used the AppleID with the iTunes store. 
    Try here >  Using an existing Apple ID with the iTunes Store and Mac App Store
    received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
    Correct.
    It's clearly not a cookie issue..
    As for cookies. Quit the App Store. Now open the Finder. From the Finder menu bar click Go > Go to Folder.
    Type this exactly as you see it here:   ~/Library/Cookies
    Click Go the move the   com.apple.appstore.plist   file from the Cookies folder to the Trash.
    Relaunch the App Store.

  • When i want to create a face time it tells me to vertify my email address. When i go to do this i have to type in my apple ID and password on the Apple website, however when ever i do this i get a message saying Invalid account for this Email Address..

    when i want to create a face time it tells me to vertify my email address. When i go to do this i have to type in my apple ID and password on the Apple website, however when ever i do this i get a message saying Invalid account for this Email Address..

    Same problem here.  Whats the deal?!  Apple??

  • I want to create a Ajax based Chating application using java .

    hi . I want to create an chating Application , and ajax based chatting application using java as my server side language ..i have some idea about it .. but one thing that i m not understanding is that how i will communicate with other users because each user has its own session so what i will do to send one messge to all the users ???? . i m new to JavaEE and i have chosen this as my semester project .. i need some help regarding this .

    First get it working without AJAX.

  • I want to create a different plug-in . Could you please send me an email adress to contact about my questions for plug-ins?

    Dear Sir / Madam,
    First of all my english is not good enough and apologise for that. I want to create a kinda different java plug-in on mozilla . I ve been playin a textbase game for many years. However it takes many hours to play it manually. I d like to create a script for that and think script will work by itself (it will read 3d codes paste them automatically, it will click some words in website automatically etc.) I saw that one on your system its called "omerta rankscript". Could you tell me how i can start to do this and ? is it easy or how long time it takes to create a new plugin like this? also may i see the codes of this plug-in(omerta rankscript)?
    Thank you for your consideration.
    Best Regards,
    Zafer ATABAY

    Depending on what you want to develop, you could consider an ''extension'' or a ''userscript''. A plugin probably is not the right type of add-on to create.
    For suggestions and assistance with these different kinds of add-ons:
    Extensions:
    * http://forums.addons.mozilla.org/
    * http://forums.mozillazine.org/viewforum.php?f=19
    Userscripts:
    * http://userscripts.org/forums
    Good luck with your project.

  • In my macbook pro retina 15 inch there is installed mavericks but ı want to create recovery disk and ı need to download mavericks from App Store but it doesn't download??

    Hey guys ı really need your help. I bought macbook pro retina 15 inch 2 weeks ago and it came with installed mavericks of course but ı want to create a recovery disk and to do that ı need to download mavericks installer from app store but when i click to download mavericks from appstore purchased part ı get a message says " Your purchasing process couldnt complete. OS X Mavericks cant be installed to this computer." How can ı solve this problem!??

    One way around tis is to borrow a Mac that can run Mavericks and then the download will work.  You can use these instructions:
    http://www.macworld.com/article/1167857/how_to_make_a_bootable_mountain_lion_ins tall_drive.html
    Though they are for Mt. Lion, the same steps will work.
    Ciao.

  • I want to create tab's in JSP..?

    Hello experts,
    I want to create tab's in JSP page. So if there is in taglib for tab's. So please let me know which one is this and how to implement it. And the directory structure of the Application folder.
    Thanks and Regards,
    Andy Surya

    Or you could write your own using divs and css, it wouldnt take very long as I have done it a couple of times. It might not be the best solution, but I made each tab section an action apart from the page you are currently on and used a separate jsp for each individual tab page. The html was replicated at the top of each page. Each clickable tab header had an action behind it fired by javascript.
    It requires a page refresh on each tab click and multiple jsp's (one for each tab) so might not be the most appropriate solution but it works very well and looks good.

Maybe you are looking for