Problem with adjusting both transparency and color of an object

I am writing a program where when an object is picked, both it's transparency and color will be altered (the object will become opaque, and its color will turn to a predefined "selected" color), while the previously selected object will return to its original transparency and color. I am able to get this to work, except that objects that were picked two or more picks ago will remain in the selected color, albeit in their original transparency. This problem only seems to occur when transparency is factored in. The picking/color & transparency altering code is as follows.
public class PickingListener extends MouseAdapter {
     private PickCanvas pickCanvas;
     private TextDisplay overlay;
     private Primitive p;
     private Primitive lastP;
     private ColoringAttributes origColor;
     private TransparencyAttributes origTransparency;
     public PickingListener(PickCanvas pickCanvasArg, TextDisplay overlayArg) {
          pickCanvas = pickCanvasArg;
          overlay = overlayArg;
     public void mouseClicked(MouseEvent e) {
          pickCanvas.setShapeLocation(e);
          PickResult result = pickCanvas.pickClosest();
          if (result == null) {
               System.out.println("Nothing picked");
          } else {
               p = (Primitive) result.getNode(PickResult.PRIMITIVE);
               if (p != null) {
                    setSelectedColor();
                    overlay.setPickedBarInfo((BarInformation) p.getUserData());
               else
                    System.out.println("null");
     private void setSelectedColor() {
          ColoringAttributes barCA = new ColoringAttributes();
          TransparencyAttributes barTransp = new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f);
          barCA.setColor(ColorConstants.SELECTED);
          if (lastP != null) {
               lastP.getAppearance().setColoringAttributes(origColor);
               lastP.getAppearance().setTransparencyAttributes(origTransparency);
          origColor = p.getAppearance().getColoringAttributes();
          origTransparency = p.getAppearance().getTransparencyAttributes();
          p.getAppearance().setColoringAttributes(barCA);
          p.getAppearance().setTransparencyAttributes(barTransp);
          lastP = p;
}Capabilities to alter the primitive's color and transparency are all set.
     barAppearance.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
          barAppearance.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
          barAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_WRITE);          barAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
ColoringAttributes barCA = new ColoringAttributes();
barCA.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
barCA.setCapability(ColoringAttributes.ALLOW_COLOR_READ);)
Any insight as to why this would occur would be greatly appreciated.
-Adrian Benton

A Behavior is the preferred way to make changes in a scenegraph. Here is an example from a previous post that changes the appearance of a shape when it collides with another shape.
The javadoc for javax.media.j3d.Behavior appears to refer to the issue you have.
Transparencies are confusing, different display adapters deal with them differently. Suggest you search the forum at
http://forums.java.net/jive/forum.jspa?forumID=70
for more detailed information.
regards
class CollisionDetector extends Behavior {
  private static final Color3f highlightColor = new Color3f(0.0f, 1.0f, 0.0f);
  private static final ColoringAttributes highlight = new ColoringAttributes(
      highlightColor, ColoringAttributes.SHADE_GOURAUD);
  private boolean inCollision = false;
  private Shape3D shape;
  private ColoringAttributes shapeColoring;
  private Appearance shapeAppearance;
  private WakeupOnCollisionEntry wEnter;
  private WakeupOnCollisionExit wExit;
  public CollisionDetector(Shape3D s) {
    shape = s;
    shapeAppearance = shape.getAppearance();
    shapeColoring = shapeAppearance.getColoringAttributes();
    inCollision = false;
  public void initialize() {
    wEnter = new WakeupOnCollisionEntry(shape);
    wExit = new WakeupOnCollisionExit(shape);
    wakeupOn(wEnter);
  public void processStimulus(Enumeration criteria) {
    inCollision = !inCollision;
    if (inCollision) {
      shapeAppearance.setColoringAttributes(highlight);
      wakeupOn(wExit);
    } else {
      shapeAppearance.setColoringAttributes(shapeColoring);
      wakeupOn(wEnter);
}

Similar Messages

  • Problem with installing both 32 and 64bit Java7u45

    Hi all.
    For some reson we need to install Java7u45 because of an inhouse made application only runs on java7u45 32bit,
    Now to my issue, we hava about 200 windows7 x64 machines who need both 32 and 64 bit java7u45.
    If i install the 32bit the inhouse appliction works, but then other third party application will not run (SoapUI, Eclipse).
    If i install both 64 and 32 bit the inhouse application will not run, i get this error message "NativeSwing[1]: Caused by: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM"
    In the Java Control Panel only the 64bit java shows up, and if i try to add javaw.exe from C:\program files (x86)\java\bin it will add the correct line, and i looks ok until i close the java control panel and open it, it will still only show the 64bit java.
    So is there anyway to change the default 64bit java to 32bit and make it stick?
    Thank you.

    panosk wrote:
    uwinkelvos wrote:This isn't GWT, is it?
    Hi, is there anybody using Eclipse and GWT in arch 64?
    I use Eclipse Galileo 64 bit and trying to use GWT I get the error "...wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)..."
    Should I nstall bin32-jre from AUR and use it to start a 32 bit version of Eclipse? Is there another way using the 64 bit version of eclipse?

  • Problem with WRT160NV2, both wired and wireless...

    I bought a WRT160NV2 Refurbed from CompUSA about 2 weeks ago, and since then I've been having some problems.
    It's not every site, but there are a few sites (three or four I've noticed)  that load very, very, very slowly. It happens using wired or wireless (Main PC is wired). I've tried rebooting both the router and modem multiple times (10 or 20 times at least) and looked through the forums and noticed some people said try setting the MTU to 1300. I tried that and it didn't seem to do anything, so I tried 1350, 1400, 1450, 1490, and 1100, with no results with either. When I connect using just my modem everything works fine. I'm frustrated because I can't find a solution to this. Any help would be appreciated. 
     Firmware Version: v2.0.03 build 007 ;Jul 2, 2009
    Message Edited by RagingShadow07 on 02-27-2010 01:48 PM

    Since you have already changed the MTU size on your Router and still facing the same problem, then i think you need to Re-flash / Upgrade the firmware of your Router...
    Download the firmware from the Linksys website and then upload the firmware on your Router... Once the firmware is upgraded on your Router, then you need to reset the router and re-configure all the settings on it again... 

  • I'm having problems with videos, they shake and the images break up back and forth into striped colors, how do I fix this?

    I'm having problems with videos, they shake and the images break up back and forth into striped colors, how do I fix this?

    1) This is because of software version 1.1. See this
    thread for some options as to how to go back to 1.0,
    which will correct the problem...
    http://discussions.apple.com/thread.jspa?threadID=3754
    59&tstart=0
    2) This tends to happen after videos. Give the iPod a
    minute or two to readjust. It should now be more
    accurate.
    3) This?
    iPod shows a folder icon with exclamation
    point
    4) Restore the iPod
    5) Try these...
    iPod Only Shows An Apple Logo and Will Not Start
    Up
    iPod Only Shows An Apple Logo
    I think 3,4, and 5 are related. Try the options I
    posted for each one.
    btabz
    I just noticed that one of the restore methods you posted was to put it into Disk Mode First rather than just use the resstore straight off, I Have tried that and seems to have solved the problem, If it has thank you. previously I have only tried just restoring it skipping this extra step. Hope my iPod stays healthy, if it doesnt its a warrenty job me thinks any way thanks again

  • IE11 Problem with Windows 8.1 and IIS 8.5

    I have upgraded my computer from Windows 8 to Windows 8.1, 64bit and IIS 8.5 is installed on the upgraded machine. I am unable to view with IE11 the default page of the default website  hosted on the local machine. The problem occurs with both
    the desktop version of IE11 and the Windows 8 metro style version.
    When Chrome is installed on the machine the page is visible but when using IE11 a "This page can't be displayed" message appears. The IIS Log Files reveal that it is receiving nothing from IE11. Other machines I have that have also been upgraded
    to Windows 8.1 exhibit the same fault.
    The strange thing is that when viewing pages on other networked machines exhibiting the same problem, you can see the pages on the remote machines but in all instances the local page cannot be viewed.
    It appears that there is a problem with IE11. Uninstalling and reinstalling IE11 does not fix the problem.
    Can anyone help me? Assitance with this problem would be most appreciated. 

    Description
    <dir>
    </dir><dir></dir><dir></dir><dir>
    Faulting Application Path: C:\Program Files (x86)\Internet Explorer\iexplore.exe
    </dir>
    Problem signature
    <dir>
    </dir><dir></dir><dir></dir><dir>
    Problem Event Name: APPCRASH
    Application Name: IEXPLORE.EXE
    Application Version: 11.0.9600.16384
    Application Timestamp: 52157231
    Fault Module Name: MSHTML.dll
    Fault Module Version: 11.0.9600.16432
    Fault Module Timestamp: 52620354
    Exception Code: c0000005
    Exception Offset: 002964a7
    OS Version: 6.3.9600.2.0.0.256.48
    Locale ID: 2057
    Additional Information 1: ab90
    Additional Information 2: ab9026eb5cad8b25f882a373e2d752b2
    Additional Information 3: d486
    Additional Information 4: d48664e52db6f0b0676e13c96e422192
    </dir>
    Extra information about the problem
    <dir>
    </dir><dir></dir><dir></dir><dir>
    Bucket ID: 45b7b98d077be82c89ec9142c2213a5f (-374769956)
    </dir>

  • My iPod says there's a problem with my last purchase and every time I try to look at my history to clear the problem it says there no connection to ITunes

    When I log into my acc it ammediatly says there's a problem with my last purchase and to go to my purchase history to clear it.  When I hit continue its suppose to take me to the history but it just loads then says cannot connect

    the itunes says that it knows that there isan ipod there, but it doesnt recognize it. I have reset the ipod, restarted my computer, and reinstalled itunes.
    Doublechecking. Have you tried a complete uninstall of both iTunes and all the other related software components (Apple Mobile Device Support, Apple Application Support, etc ...) and then a reinstall? If not, try the instructions from the following document:
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8

  • Transparency and color blend space: fail!

    Hi there. I keep trying to export my pdf, to no avail.
    I get an error that pops up that says there is an error with my transparency and color blend space.
    HOWEVER, all my images are set to CMYK (it says so in the links panel) and my transparency blend space is also set to CMYK. I have no errors in my preflight panel. When I ignore the message and continue to export, the image looks completely different and not the way I want it to show up.
    Please let me know how I can fix this error! Thanks so much!

    Document CMYK is the assigned profile in Edit>Assign Profiles.... Working CMYK is Color Settings...>Working Spaces>CMYK. If there's no profile assigned, document and working are the same. So in this case Document CMYK is Coated FOGRA27 and Working CMYK is US Web Coated SWOP—the assigned FOGRA is color managing the document's native CMYK colors not the working US SWOP

  • I have a problem with the effect gallery and the saving libraries in Illustrator CS6

    Hi everybody
    I have a problem with the effect gallery and the saving libraries in Illustrator
    1. When you go to to effects > effect Gallery the the sketch filter always is black and white. Is this normal? In Photoshop you can set your background and foreground and the sketch effects takes those colors. Is there any way to do this in Illustrator? I have tried changing the colour of the fill and stroke but nothing...
    2. In the same area as before effects > effect Gallery .... In Photoshop you can add multiple filters with the create new button. Always is off is there anyway to make it available? or the only way is to by creating several individual ones and manage then in the appearance panel ...
    3. I saved a brush library and now it appears in the user defined area so I can get it in any document, that is good but any one knows how to delete a user undefined library?
    Many thanks in advance for the help .... I look forward for the reply =)

    I see that it is six months ago that I first posted this. Nothing has changed. When I use affixa to create a message with an attachment from my gmail account in firefox, the message is created in drafts, but the gmail window is closed and I have to re-open it. Not critical, but annoying.
    Now there is a plug-in on the affixa site that is supposed to be designed for Firefox, and which affixa support claims should take care of this. And I've downloaded it twice. When you download it and open it, it says that it will be installed when Firefox restarts, and gives you a button to restart Firefox. But after you click that button and firefox disappears and re-appears, the affixa plug-in is NOT in the plugin list.
    Please, somebody, HELP.

  • Strange problem with SQLPLUS when client and server on the same box

    Hi,
    I have the problem with SQLPLUS when clinet and server on the same machine.
    With client and server on the same machine i am running the command
    sqlplus -l username/password@connect_identifier as SYSDBA.
    With this command, even if you pass in wrong username or wrong password or both as wrong you can able to connect to database and execute queries.
    Once Connect_identifier is correct and trying to log in as SYSDBA ,sqlplus will log in to DB with any username and password.
    How to get rid of this behaviour. Is there any way to do this.
    I am running this command by creating a process in C#
    Edited by: user11000236 on Jun 16, 2009 10:31 AM

    user11000236 wrote:
    Thanks for the info.
    How does Oracle/SQLPLUS allows any username or password to log in to DB with SYSDBA Privillages? What is the concept behind this.?
    This is explainted in the above mentioned link:
    Operating system authentication takes precedence over password file authentication. If you meet the requirements for operating system authentication, then even if you use a password file, you will be authenticated by operating system authentication.

  • Wireless printing problems with 10.5.4 and Epson printers

    Anyone else know about problems with Epson printers such as this no longer functioning wirelessly with bonjour once upgrade to 10.5.4? It appears they are not supporting this with a new driver yet?
    At this time, Epson says they have no drivers for 10.5 and this specific printer but wondered if there are more general problems with 10.5.4 and bonjour with Epson or others?
    Thanks
    Paul
    MacBook Pro Mac OS X (10.5.4) Using Epson CX11-NF printer

    I have 5 computers-G4 PowerPC, two G4 12" laptops, G5 Mac Pro dual, Macbook Pro--with the older computers all running 10.4.11, the new ones 10.5.4. Until Friday, I was able to print with all of them to an Epson Stylus Photo R200 via Airport Extreme. After installing software for my new G3 iPhone on the G5 Mac Pro the printer connections on all the computers stopped working. I have so far been able to get the G4 Power PC to print, but none of the others. I have tried Bonjour, Gimp-print v.5.0.0-beta 2, cleared all the print drivers and restarted, and everything else I have been able to find on both Epson and Apple sites. The Printer Set Utility described by Epson does not exist in Leopard machines, and doesn't work for the older laptops. As soon as I select one of the printers in the "selected printer in print dialogue box" it grays out. I have set up sharing on the G4Power PC that does print, but it is not accessible--it shows up but is grayed out. There is a diamond next to the printers in the Print dialogue box in applications' menus, but it still doesn't work. It either cannot make the connection, cannot find the printer, or keeps spinning with the message that it is finishing printing (but it hasn't even started.) Again, everything worked fine until the new iPhone was added to the mix. My old iPhone didn't cause any problems. This is really a problem. Any suggestions welcome.

  • Problems with Apple Wireless Mouse and Keyboard

    Last week my keyboard started repeating letters and not responding and the mouse started acting like an old mouse with a dirty trackball. I searched many message boards and got no help for my specific problem. I'm on a PowerPC G5 running OS 10.3.9.
    Batteries are good. I have run both a hardware test and disk utility with no problems found. The problem seems to have shown up after an apple software update. Don't know if that could have caused some sort of system incompatibility problem.
    Since both mouse and keyboard work with my powerbook, I don't know what else to do. I have re-paired both mouse and keyboard and had some problems with them showing up. I also have shut down the system, unpluged everything and started up again but nothing has worked.
    If anyone has an answer I would be really greatful. Please help. thanks

    Hi again,
    No, I had not even thought of that. I just unplugged it and plugged it back in and the problem may be fixed!!!!!
    Since the problem is intermittent, I'm not sure yet. The worst trouble I've been having has been in trying to drag things across the screen and I have just been able to do that with several windows.
    Yeah!!! I think you may have done it. I will keep this thread open for a while but I think that was it. You my friend are a genius! I'm a bit embarassed to have not thought of that. I didn't even remember that that antenna existed.
    thanks sooooooo much.

  • Problems with AOL e-mail and Droid Charge

    Problems with AOL e-mail and Droid Charge
    After setting up my AOL email account on my Charge, it has been syncing new messages ok, but I've been having other problems:
    - Syncing AOL mail: I have the Charge set to sync 50 emails (set up the same way as my Comcast Account) but the AOL account pulls up the last 50 old emails and delivers them to the phone. (Comcast does not do this). If I delete these old messages, it just pulls up the same amount of even older mail. Very frustrating. Because of the 2nd problem below, some of these messages were actually deleted on my AOL account before I realized what was happening. It seems I have to just keep 50 old mails on my Charge to prevent this from happening. Any ideas?
    - Second problem (kinda related) Deleting Old Mail: When I delete AOL emails I have read on the Charge, they are also deleted from my 'old mail' folder on AOL and sent to deleted mail. This is not how it worked on my BB Storm2. After deleting them with the Storm, the AOL mail would show them as read and put them in 'old mail' unless I told the Storm to delete them from the server. I cannot find any "choice" option on the Charge. I hate this because the "deleted mail" folder on AOL dumps its contents much more quickly than the "old mail" folder. How do I stop this from happening?
    FYI, both Comcast and g-mail are working as they should.....
    Thanks,

    Dear Richs10,
    As to the second problem, I have seen this before in other threads. The only solution I can come up with is to delete the AOL account and set it up on the phone from scratch. The reason for this is that the ONLY time you are able to see the option for leaving email on the server (or removing them) after reading on the phone is during the account setup process. After the account is set up, there seems to be no way to access this setting again. Kind of dumb, IMHO, but that seems to be the case.
    If you need step-by-step walkthrough of the account setup, PM me.

  • Why I had no problems with the VZW employees and other people have?

    I think that most people who cannot resolve problems with the VZW have an attitude problem.
    Wise saying:  you can get more with honey than with vinegar.
    Since I “upgraded” my old Samsung Sway to a new Samsung Intensity III, in the past three weeks I spent many hours dealing with the VZW store employees, customer service reps, and tech support people. The phone was replaced two times, and I had no problem getting the replacements.
    The third phone did not working how I expected.
    Today I called VZW customer service and said I don’t need anymore trouble shooting and I wanted find a resolution, which will be satisfactory to both of us. After a short conversation with a customer service rep, I was connected with a tech support. I told him that I don’t need any more trouble shooting on the Samsung Intensity III because I already spent HOURS doing that on three devices.
    We spoke about what the VZW could offer me, about replacements with different phones, etc. Our conversation ended with me offering the resolution that could satisfy me, which was to keep this phone and my account will be credited for the $30.00 “upgrade” fee and I will buy Samsung Sway on eBay. NO PROBLEM. 
    My account was credited and I was advise about the ESN number and activation.
    Why I had no problems with the VZW employees and other people have? The answer is simple. I did not have attitude when I was spoke to them.
    So if you want the problem to be resolved, put your anger in you pocket before you start the conversation. You can say that you are angry, frustrated, etc like I did, but add that you understand that this is not their fault that the manufactures makes a crap phones.

    Yes, you are right. I lost my upgrade. Also, it’s true that I could buy the phone on eBay… if I knew then what I know now. In the past, I never had problem with any of my phones. Doing an upgrade with the VZW was a normal thing for me. I didn’t expect that Samsung Intensity III would be a junk phone.  My last upgrade was 4 years ago. I had $50.00 ‘new every two’ credit on my account, which was used for an upgrade.  I lost the $50.00 credit paying for Samsung Intensity III. Sometimes we learn from our mistakes or from a bad experience. Three weeks ago I did not know that I could buy a phone on eBay and activate with VZW without paying $30.00.
    Samsung Sway is coming from …eBay – keep your fingers crossed for me.

  • I downloaded a new version of firefox. It said it had problems with my norton toolbar and now it doesn't feature it in the window. I'm not that comp savvy. How do I either get the Norton toolbar up or go back to the old firefox? Thank you.

    I downloaded a new version of firefox. It said it had problems with my norton toolbar and now it doesn't feature it in the window. I'm not that comp savvy. How do I either get the Norton toolbar up or go back to the old firefox? Thank you.

    Please authorize ADE 3 with same credentials that you used with older version of ADE

  • After having yet another problem with my MacBook Pro and having to wipe the drive, I am now unable to sync my iPhones etc without erasing all the music on them. Is there a way around this? I have no other library!

    After having yet another problem with my MacBook Pro and having to wipe the drive, I am now unable to sync my iPhones etc without erasing all the music on them. Is there a way around this? I have no other library!
    iTunes is a mess! It couldn't find it's own libraries and I was forced to create a new one. Now I don't know where my music is or if any's missing.

    columbus new boy wrote:
    How crap is that?
    It's not crap at all.
    It's not that simple. For example, I've 3500 songs on my MacBook but don't want them all on my phone, so I have to manually select each song again???
    There has to be a solution.
    Why not simply make a playlist with the songs you want on the iPhone?
    and maintain a current backup of your computer.

Maybe you are looking for

  • No Sound. Speaker "on" "off" button not functioning

     I have an HP Pavillion Laptop which was purchased in the last 9 months. Don't know what kind of sound board is installed.  Running Windows 8. Upgraded to Windows 8.1 last week and now I don't have any sound. When I press the Speaker "On/Off" button

  • 0FIAR_O03-Issue

    Hi, My ODS is 0FIAR_O03 is a business content ODS receives data from 0FI_AR_3 and 0FI_AR_4(Customers: Line Items (Extraction Linked to 0FI_GL_4). I am able to load INIT and delta for 0FI_AR_3 infosource. But when I am trying to load the INIT for 0FI_

  • Vendor Acknowledgment for PO using Inbound Idoc.

    HI, I have a scenario, where we send the PO to the supplier through Idoc, which is sucessfully recieved, when the supplier tries to send the acknowledgment for the PO through Idoc the Idoc fails with an error message "Confirmed price cannot be set in

  • Multiple Columns in MiniTOC

    In RoboHelp 9, I know the MiniTOC is pretty much locked down tight so that it's manipulation is quite limited, but is there a way to create a minitoc that displays the items in columns? Some topics have many headings that are included in the MiniTOC

  • PDFs causing my CT3 to close

    So I am the admin and i am the one who reviews and publishes drafts - all of a suddent his morning, if someone sends me a PDF file, i can't publsih it. i click on the page title in the draft console and Contribute closes - no error message, no nothin