Adding Two Spheres to Same Transform Group

Should be a simple question. How do I add two spheres to the same TransformGroup?
With this code, only one sphere is displayed:
TransformGroup tg = new TransformGroup();
Sphere sphere001 = new Sphere(0.1f);
Vector3f vector = new Vector3f(0.0f, 0.0f, 0.0f);
Transform3D transform = new Transform3D();
transform.setTranslation(vector);
tg.setTransform(transform);
tg.addChild(sphere001);
Sphere sphere002 = new Sphere(0.1f);
Vector3f vector002 = new Vector3f(0.0f, 0.5f, 0.0f);
Transform3D transform2 = new Transform3D();
transform2.setTranslation(vector002);
tg.setTransform(transform2);
tg.addChild(sphere002);

Not totally sure but i think the second tg.setTransform() overwrites the previous transform thus both spheres are transformed to the same insertion point, so the 2nd sphere is "covering" the 1st? Maybe each transform group can only apply 1 common set of transform on all child objects.
I had a similar problem and the following works for me:
Try putting the 2 spheres in seperate BranchGroups, this ensures that there are 2 independent transforms. You can then add the 2 BranchGroups to either your SimpleUniverse to be displayed (i'm guessing thats your objective) or even to another common TransformGroup (say you want the 2 spheres to be inserted at 2 differnt points but then moved together to another location)
//1st BranchGroup contains some Transform Group
BranchGroup bg1 = new BranchGroup();
TransformGroup tg1 = new TransformGroup();
Sphere sphere001 = new Sphere(0.1f);
Vector3f vector = new Vector3f(0.0f, 0.0f, 0.0f);
Transform3D transform = new Transform3D();
transform.setTranslation(vector);
tg1.setTransform(transform);
tg1.addChild(sphere001);
bg1.addChild(tg1);
//2nd BranchGroup constains another Transform Group
BranchGroup bg2 = new BranchGroup();
TransformGroup tg2 = new TransformGroup();
Sphere sphere002 = new Sphere(0.1f);
Vector3f vector002 = new Vector3f(0.0f, 0.5f, 0.0f);
Transform3D transform2 = new Transform3D();
transform2.setTranslation(vector002);
tg2.setTransform(transform2);
tg2.addChild(sphere002);
bg2.addChild(tg2);
//eg, moving the 2 spheres together after they are inserted in different places
TransformGroup moveTogether = new TransformGroup();
Vector3f vector003 = new Vector3f(0.2f, 0.2f, 0.2f);
Transform3D transform3 = new Transform3D();
transform3.setTranslation(vector003 );
moveTogether.addChild(bg1);
moveTogether.addChild(bg2);

Similar Messages

  • Adding two boxes in same branch group

    Hi,
    I am new to Java3D. I want to add two boxes in same branch group at different location so that both of them are visible simultaneously. Can i achieve it?
    Thanks and regards,
    Rahul

    Thanks.
    But Still i have problem. Probably i was not clear earlier. My problem is not just to add these boxes. But in addition i want to same behaviours like Rotation, Zooming, Translation etc on all of these boxes. So that they all can be zoommed, translated, rotated by equal factor simulataneously.
    Please help me.
    Thanks lot
    Regards
    Rahul

  • Problem in Adding two buttons under same column header (in JTable)

    Hi,
    I have a JTable and to a particular column i want to add two buttons.
    Here the two buttons should be under the same column header and i need to add listners to these.
    Any idea how to do this?
    Thanks & regards
    Neel

    Of course as your header is drawn by a renderer, the buttons don't actually work, but you can listen for mouse clicks within the area of the header and see which button the mouse position was over.
    See the Java Table Sorter Demo code for how to add a mouse listener to the header...
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableSorterDemo
    ....and from there you should be able to determine where in the component the click occured by using the getX() and getY() methods of the MouseEvent to determine which button in the renderer component was clicked. Use something like Rectangle.contains() to match the click location against the buttons.

  • Can't put two 5508 WLCs in the same RF group

    Hi experts,
    I have two 5508 WLCs and I want them to be backup to each other. I put in the same "RF Group Name" and even the same "Default Mobility Domain Name" however under Wireless -> 802.11b/g/n -> RRM -> RF Grouping each controller still only have themselves as the only memter to the group.
    Two controllers are having management IPs on the same subnet 192.168.161.x/24. AP-manager interfaces are in the same network as well. They can ping each other fine. The following screen shots show the current relavent config on the controller:
    I do have two controllers in the same mobility group and they are both showing up...
    Does anyone know why they can't add each other to the RF group? All other settings are pretty much default...
    Thanks!

    Hi,
    is there a chance that one of the 2 WLC doesn't contain any access point ? Or that the APs from one WLC are not physically close to the APs of the second WLC ?
    The point of RF grouping is to exchange RF information, to make RRM decisions together and to know what ap is a rogue and which is not. RF group information travels over the air from AP to AP.
    So if a wlc has no ap of if its APs are not close to those of the other WLC there is both no point in grouping with the other WLC in rf group and also no technical way of doing so.
    Regards,
    Nicolas
    ===
    Don't forget to rate answers that you find useful

  • Can we assign two repeating frames to have the same source(group)?

    hi all,
    can we assign two repeating frames to have the same source(group)?..pls reply soon... bye..

    You can assign the same source group to two repeating frames.
    For more information on repeating frames, refer to the Oracle Reports Building Reports manual available on OTN: http://www.oracle.com/technology/documentation/devsuite.html

  • Printout amount showing differently for two vendors of same group

    hi ,
    i am facing a problem . we have two imported vendors created on 2004 belongs to same vendor group.
    order currency for both vendors is : USD.
    when we give print out for PO,
    for one vendor it is giving as :12,200.00 USD
    for another vendor it is showing as :13.500,00 USD
    i want to make both the vendors in same notation .
    can any one suggest where diference in settings is .
    rgds
    Chalam

    hi Simha,
    this could be controlled by the country of the vendors, pls. have a look which countries are assigend. In transaction OY01 you can check the country settings for decimals and thousands.
    hope this helps
    ec

  • Can we give same Excise Group to two diff.  Plant within same company code

    Hi,
    Can anyone please tell that whether we can assign same Excise Group to two different plants within the same company code in SAP.
    Regards,

    Yes you can use but, you shouldn't use same excise group for two different plants in one company code, if their physical location is different.
    As many excise report are fetched on the basis of excise group, there it will show combined values for both plants, whcih may not be acceptable to exices authorities.
    Regards,
    Sachendra Singh

  • I have duplicate email accounts icons, NOT recieving duplicate emails just two of the same email icons

    I had a blackberry curve 8310 with ATT. I transferred carriers and got a new bold 9650 with sprint. I transferred data from old curve to new bold. But the old email didn't work on new bold. So I went to set up BIS with sprint, it added email account that works. But now I have two icons with the same email address. One works and one doesn't so it is confusing when I am selecting address to compose email. How do I delete email icon/account. I hid the icons but when composing email, it still shows two of the same email in the From:

    Hi and Welcome to the Forums!!
    I suggest the following steps, in order, even if they seem redundant to what you have already tried (steps 1 and 2 each should result in a message coming to your BB...please wait for that before proceeding to the next step):
    1) Register HRT
    KB00510 How to register a BlackBerry smartphone with the wireless network
    2) Delete and Resend Service Books
    KB05000Delete the service book for the BlackBerry Internet Service email account from the BlackBerry smartphone
    KB02830 Send the service books for the BlackBerry Internet Service
    3) Batt Pull Reboot
    Anytime random strange behavior or sluggishness creeps in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Hopefully that will get things going again for you!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • Monitoring two servers with same IIS configuration using SCOM

    Hello,
    We have two servers which has the same IIS configuration including sites names, how do we configure APM to monitor and get events captured on two different monitors on SCOM 2012 R2.
    Thank you, Anand
    Anand Franklin

    Hi Anand,
    There is no problem at all, if applications IIS paths (Web Site names + Web application name in IIS) absolutely match. Make sure both servers have SCOM Agent installed and connected to the same Management Group.
    In .NET Application Performance Monitoring template just keep Target Group field blank (it's blank by default) - that will mean the application will be monitored on each server within Management Group where it's discovered. The same configuration of
    APM monitoring will be used for all app instances.
    If you want to monitor the app only on two servers, and at the same time the app is hosted on more than these two boxes, you can create Windows Computer group populated with appropriate servers and specify this group as Target for APM monitoring.
    If you want to differentiate APM configuration for specific app instances, you should create several Windows Computer groups and bind each group with separate configuration - in this case you will have to run .NET Application Monitoring template several
    times, picking up the same app, but changing APM settings and setting new Target Group.
    Igor Savchenko, VIAcode Consulting LLC (http://www.viacode.com/)

  • Spliting a table in to two table based on the groups in SSRS

    Hi,
    I am trying to a split a rows accross two tables based on a group.
    So far I have added a list and added a row group and grouped it using lineof business
    Inside my list i have two identical tables so i can display the data
    for the first table i have set the row visibility as follows: where LineOfbusiness1 is the  groupname of my list group
    =RowNumber(Nothing) >= (IIf(CountRows("LineOfBusiness1")\2 = 1, CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
    and for the second table in the i have set the row visibility as follows
    =RowNumber(Nothing)< (IIf(CountRows("LineOfBusiness1")\2 = 1,CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
    this set up works fine for the first group but it doesnt display the data the way i want for the subsequent groups.
    so how do i have the table start over after each group... plus in my group i have specified to do a page break after everygroup...
    Any help will be appreciated.
    Thanks
    Karen

    Visakh,
    Thanks for answering.... a sample for the data will look like
    dataset----
    create table #dataset
    Code varchar(5),
    Name varchar(200),
    Lineofbusiness int,
    Statename varchar(10),
    typed int,
    description varchar(2000)
    insert into #dataset
    select 45111,abc,1,AL,4500,policies
    insert into #dataset
    select 45111,abc,1,AL,2500,vehiles
    insert into #dataset
    select 45111,abc,1,AL,3,drivers
    insert into #dataset
    select 45000,bca,2,AL,4500,policies
    insert into #dataset
    select 45000,bca,2,AL,500,house
    insert into #dataset
    select 45000,bca,2,AL,40,theft
    When i display the data i want it to be
    Line of business 1
    policies 4500 drviers 3
    vehiles 2500
    Line of business 2
    Policies 4500 theft 40
    House 500
    but right now the for lineofbusiness 1 its showing the correct way for but the line 2 everything is being displayed in the right.
    Thanks
    Karen

  • Two actions on same day

    hi,
    We have requirement where we need to run the two actions on same day
    Hiring actions
    Change in pay action
    In hiring action basic pay has to come as mention in pay scale group then they want to run one more actions called change in pay on same day where they would maintain basic pay
    My doubt is that will we able run two actions on same day if yes,
    I have actived IT0302 addition action and T77S0 Table as  ADMIN              EVSUP  1
    Please let me know what the other settings I have to do 
    I am getting below error when I run two actions on same day

    You can excute multiple actions for an employee on same date in PA40
    For Example:
      An Employee of a company , got Hired and Change in Pay on the Same date.
    You need to execute  RPUEVSUP program  for Activation of Additional Actions  and
    In T77S0 table: below values should be maintained
    Group name Semantic abbr.    Value
    ADMIN           EVSUP                1
    In T529A table:below value should be maintained
          Field                         Value
          Action Type              A3 (Hiring)
          Update IT0000           X
          Update IT0302           X
          Field                         Value
          Action Type              A9 (Change in Pay)
          Update IT0000           X
          Update IT0302           X
    I hope this will resolve your issue

  • How do you add a ViewingPlatform to a Transform Group, and make it move?

    Hello,
    I am reasonably new to Java3d and have been looking around the forum about how to add a ViewingPlatform to a transform group. I did find several posts and they did help to get me to put a ViewingPlatform into a transform group, but now I have a problem of not being bale to move it:
    The public void actionPerformed(ActionEvent e ) is where the code changes the xloc and zloc variables and make the transform group move. However I get an error when I try to add the Camera to this transform group which is moved.
    Thanks in Advance.
    Mahen.net

    My code is:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.WindowAdapter;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import com.sun.j3d.utils.geometry.Sphere;
    import javax.swing.Timer;
    import com.sun.j3d.utils.geometry.ColorCube;
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.*;
    public class BouncingBall extends Applet implements ActionListener, KeyListener {
         private Button go = new Button("Go");
         private TransformGroup objTrans;
         private TransformGroup vpTrans;
         private Transform3D trans = new Transform3D();
         private Transform3D trans2 = new Transform3D();
         private Timer timer;
         private float xloc=0.0f;
         private float zloc=0.0f;
         public BranchGroup createSceneGraph(SimpleUniverse su) {
            BranchGroup objRoot = new BranchGroup();
            // lanscape
            TransformGroup tg = new TransformGroup();
            TransformGroup tg1 = new TransformGroup();
            TransformGroup tg2 = new TransformGroup();
            TransformGroup tg3 = new TransformGroup();
            TransformGroup tg4 = new TransformGroup();
            tg.addChild(tg1);
            tg.addChild(tg2);
            tg.addChild(tg3);
            tg.addChild(tg4);
            Transform3D transform1 = new Transform3D();
            Transform3D transform2 = new Transform3D();
            Transform3D transform3 = new Transform3D();
            Transform3D transform4 = new Transform3D();
            transform1.setTranslation(new Vector3f(2.0f,0.0f,0.0f));
            transform2.setTranslation(new Vector3f(-1.5f,0.0f,0.0f));
            transform3.setTranslation(new Vector3f(1.0f,1.0f,-2.0f));
            transform4.setTranslation(new Vector3f(-2.0f,-1.0f,1.0f));
            tg1.setTransform(transform1);
            tg2.setTransform(transform2);
            tg3.setTransform(transform3);
            tg4.setTransform(transform4);
            tg1.addChild(new ColorCube(0.4));
            tg2.addChild(new ColorCube(0.4));
            tg3.addChild(new ColorCube(0.4));
            tg4.addChild(new ColorCube(0.4));
            objRoot.addChild(tg);
            //character
            objTrans = new TransformGroup();
            objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            objRoot.addChild(objTrans);
            objTrans = new TransformGroup();
            objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            Transform3D pos1 = new Transform3D();
            pos1.setTranslation(new Vector3f(0.0f,-0.5f,0.0f));
            objTrans.setTransform(pos1);
            // loading object
            try
                   Scene s = null;
                   ObjectFile f = new ObjectFile ();
                        f.setFlags (ObjectFile.RESIZE | ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY);
                   String s1 = "gun.obj";
                   s = f.load (s1);
                   objTrans.addChild (s.getSceneGroup ());
              catch (java.io.FileNotFoundException ex){
            objRoot.addChild(objTrans);
            // lighting
            BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
            Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);
            Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
            DirectionalLight light1  = new DirectionalLight(light1Color, light1Direction);
            light1.setInfluencingBounds(bounds);
            objRoot.addChild(light1);
            Color3f ambientColor = new Color3f(1.0f, 1.0f, 1.0f);
            //camera
            Vector3f translate = new Vector3f();
            TransformGroup vpTrans = new TransformGroup();         
            vpTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            vpTrans = su.getViewingPlatform().getViewPlatformTransform();
            vpTrans = new TransformGroup();
            vpTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            Transform3D T3D = new Transform3D();     
            T3D.setTranslation(translate);
            translate.set( 0.0f, 0.0f, 3.0f);
            vpTrans.setTransform(T3D);
            return objRoot;
         }

  • Problem araised in  adding two custom fields to ksb1 tcode.

    hi experts,
      I added tow fields vendor no, vendor name to Tcode:KSB1.
    i used user-exit :   coomep01 .
    in this exit i added two fields to ci_rkpos (include table) . i.e zlifnr,zname1.
    but that problem is ci_rkpos is not appearing in green color it means it is not transported .
    in development  client is working properly .
    using sm34 i added fields names.
    error is coming like this.
    The following syntax error occurred in the program SAPLXKAEP :
    "The data object "CS_RECORD" has no component called "ZLIFNR", but ther"
    Error in ABAP application program.
    The current ABAP program "SAPLKAEP" had to be terminated because one of the
    here wat ever we add the zfields will appear in kaep_coac ,so in this structure two added fields are appeared in dev client
    but,the same zfields when transported to quality is not appearing .
    please suggest how to do??

    hi breakpoint.
    yes i attached  in transport.
    in quality client.
    wat ever i wriiten code  in user exit it is coming ,but
    incldue table structure is not coming ,and even that fields are appearing in v_tkalv ,but in structure kaep_coac
    blank include strcuture CI_RKPOS is appearing ,but
    in dev client is working properly, and in quality first of all report is going to dump.
    here this tvode is using all 3 plants,how can i restrict to specified plant so that ,it will not affect others plant.
    suggest me how to do??
    Edited by: kamalsac on Aug 18, 2010 10:57 AM

  • Adding two column data  from two different tables.

    Hi, I have two tables i want to add two column with same id and put it in third table
    T1 is
    id Value
    1 50
    2 100
    3 500
    4 75
    T2 is
    id Value
    3 -20
    4 80
    5 -30
    6 -10
    I want the out put as
    1 50
    2 100
    3 480
    4 155
    5 -30
    6 -10
    i have written
    select a.id,a.value+b.value from t1 a,t2 b where a.id=b.id(+)
    this is not giving me the id's from t2.

    select id, sum(value) from
    (Select id,value from t1
    union
    select id ,value from t2
    )group by id;

Maybe you are looking for