How to make a plane semi-transparent

Hi everyone. I am new here, and would like to thank you in advance.
I am trying to make a semi-transparent plane using 3D with QuadArray. Have set TransparencyAttributes accordingly; and have even tried TextureAttributes. It just doesn't cut it.
Without setting transparency, the plane is visible both sides. But once transparency set, it becomes invisible.
Can anyone give me some ideas? Thanks!
Here's the code snippet dealing with this plane:
Appearance ap = new Appearance();
TransparencyAttributes transparency = new
TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f);
ap.setTransparencyAttributes(transparency);
PolygonAttributes cullAttribute = new PolygonAttributes();
cullAttribute.setCullFace(PolygonAttributes.CULL_NONE);
ap.setPolygonAttributes(cullAttribute);
TextureAttributes texture = new TextureAttributes();
texture.setTextureMode(TextureAttributes.BLEND);
ap.setTextureAttributes(texture);
Point3f points[] = new Point3f[4];
points[0] = new Point3f(-0.2f, 0.2f, 1.0f);
points[1] = new Point3f(0.2f, 0.2f, 1.0f);
points[2] = new Point3f(0.2f, -0.2f, 1.0f);
points[3] = new Point3f(-0.2f, -0.2f, 1.0f);
QuadArray planeVertices = new QuadArray(4, QuadArray.COORDINATES|QuadArray.COLOR_3);
planeVertices.setCoordinates(0, points);
Color3f colors[ ] = new Color3f[4];
for(int i = 0; i < colors.length; i++){
colors[i] = new Color3f(1.0f, 1.0f, 0.0f);
planeVertices.setColors(0, colors);
Shape3D plane = new Shape3D( );
plane.setGeometry(planeVertices);
plane.setAppearance(ap);
********************

I just found that if I leave the colors undefined for the plane (a Shape3D); that is, remove the QuadArray.COLOR_3 flag, then the transparency works. Unfortunately, in that case, I can only have a white plane, and there's still no way for me to add color to the plane with its transparency maintained.
The right way seems to be using QuadArray.COLOR_4 flag instead. But somehow I can't get it to work. That is, no matter what value I am using for the Alpha value, the plane just remains opaque.
Can anyone give me some suggestions? Thanks a lot!
Message was edited by:
senore100

Similar Messages

  • PS 6.1, how to make a white background transparant?

    how to make a white background  transparent?

    Select the white background with Magic Wand tool.  Hit Delete.  Transparent background is denoted by the checkerboard pattern on your document.
    Nancy O.

  • How to make the status bar transparent

    can anyone help?

    Here it don`t make the status bar transparent...
    I`m trying to make UINavigationBar transparent too like Photo App and trying it but get nothing:
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
    [navigationController.navigationBar setTintColor:[UIColor colorWithWhite:0.2 alpha:0.6]];
    Some other idea how they do this? An application called Style.com do the same..
    Thank you

  • How to make a selection partially transparent?

    Hi. I open a jpg image in PS, use a quick selection tool to select what I want and then I'd like to make that selection 80% transparent. How do I do that?
    Thank you.

    One way is to convert the background layer to a regular layer, add a layer mask after making the selection, invert the layer mask and use the masks panel to control the transparency (density setting) of the selection.

  • How can I capture a semi transparent window?

    Hello all
    I am trying to grab an image of a semi transparent window into a bitmap. I have tried using both CopyFromScreen and BitBlt using the window handle but in both cases all I get is the image from behind the window I want to catch, it's like the semi transparent
    window is completely invisible to both capture methods. Is there any way I can capture the window I want?
    Thanks
    Rich

    Here is an example. You can try it in a new form project with 1 Button and 1 PictureBox added to the form. As i said, it is just an example so, when it is run the form will be partialy transparent. Click the button and it will capture the whole screen including
    your transparent form. Then it will set the forms opacity back to 1.0 so you can see that the transparent form was captured in the image.
     You will need to set it up to be used in a practical way. This is just a quick test example.
    Imports System.Runtime.InteropServices
    Public Class Form1
    Private Const CAPTUREBLT As Integer = &H40000000
    Private Const SRCCOPY As Integer = &HCC0020
    <DllImport("gdi32.dll", EntryPoint:="BitBlt")> _
    Private Shared Function BitBlt(ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <DllImport("user32.dll", EntryPoint:="GetDC")> Private Shared Function GetDC(ByVal hWnd As System.IntPtr) As System.IntPtr
    End Function
    <DllImport("user32.dll", EntryPoint:="ReleaseDC")> Private Shared Function ReleaseDC(ByVal hWnd As System.IntPtr, ByVal hDC As System.IntPtr) As Integer
    End Function
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'set this form so it is partialy transparen. Just to show it was captured for this example
    Me.Opacity = 0.5
    PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'if the picturebox has an Image the Dispose it first
    If PictureBox1.Image IsNot Nothing Then PictureBox1.Image.Dispose()
    'define the rectangle area of the screen to capture (whole screen in this case)
    Dim CaptureRectangle As Rectangle = Screen.PrimaryScreen.Bounds
    'Assign the new image captured from the screen to the picturebox image
    PictureBox1.Image = CaptureScreenImage(CaptureRectangle)
    'just so you can see the image better set the form`s opacity back to 1.0
    Me.Opacity = 1.0
    End Sub
    Private Function CaptureScreenImage(ByVal rect As Rectangle) As Bitmap
    Dim scrnHdc As IntPtr = GetDC(IntPtr.Zero)
    Dim bmp As New Bitmap(rect.Width, rect.Height)
    Using grx As Graphics = Graphics.FromImage(bmp)
    Dim grxHdc As IntPtr = grx.GetHdc()
    BitBlt(grxHdc, 0, 0, rect.Width, rect.Height, scrnHdc, rect.X, rect.Y, SRCCOPY Or CAPTUREBLT)
    grx.ReleaseHdc(grxHdc)
    ReleaseDC(IntPtr.Zero, scrnHdc)
    End Using
    Return bmp
    End Function
    End Class
    If you say it can`t be done then i`ll try it

  • How to make UIPagecontrol of UIPageviewController transparent?

    I am using UIPageviewController in my application where i want to make UIPagecontrol of UIPageeviewController transparent.
    While giving background color to clear color its not working but when giving background color to any other color like red itsworking fine.

    With this image, it will be easiest to select the white background.
    1. I would recommend using the Quick Select Tool. Select the white background.
    2. Because you want the lung guy on his own layer not the white background, you need to invert the selection. Select<Inverse.
    3. Copy the lung guy onto his own layer. On PC, press ctrl + J. If on a Mac, the shortcut is cmd + J.
    4. You can now copy/paste lung guy in the desired photo. Alternately, you can drag his layer from the layers palette and drop him into the other document. (If the resolution of lung guy doesn't match your image's resolution, he will shrink or expand as his layer will take on the resolution of the document he is moved into.)
    Note: I would not use the lettering as you can see where the lung guy's image overlaps. It will be an easier project if you redo the lettering in Word or use the Photoshop Element's text tool...maybe with text warp and a layer style....to add the text.

  • How to make a white background Transparent

    I would like to to select the blocks and enclosed data to copy and paste in a poster, leaving out the white background.  In other words make the white background transparent. 
    This is just a plain low res jpg.
    This seems like it would be pretty easy but not for me.  Is there a tutorial that could guide me through this?
    Thank you for any guidance you can give me.

    I'm probably not being clear about what I'm trying to do.  Here's a typical poster.  I use the magnetic lasso to select an image, copy and paste it resulting in this.
    This time it's to be a team picture with small head shots of each player, action photos in the background, similar to this.  I can do all that but I wanted the tournament chart to lay on top of the background with just the boxes and enclosed info showing.  I know I can use the magnetic lasso or the poly lasso but I don't have enough patience for that.

  • How to make a checkbox circle transparent

    I would like to use acrobat to insert checkbox fields on a heathcare form such as the one below.  I would like the checkbox option to be a circle that would circle the number but be transparent to show the number below it.  This may not be possible but I thought I would see if anyone has an idea.  Thanks.

    AcroForms are the forms produced directly in Acrobat with the tools there. You can also get to Designer from Acrobat and create forms there. Once you go to Designer, you can not return to Acrobat for any editing since the Designer PDF is actually a XML package.
    It sounds like you may have used the same selections as I did in AcroForms, though I think you used a check box and not a radio box. I used radio boxes that are a circle by default. The check boxes are squares by default. The basic difference is that the check boxes are either independent (with different names) or identical (with identical names). The radio boxes are either independent (with different names) or only one can be selected at a time (with identical names). Thus, if you name a group of radio boxes with the same name, but different responses, selecting any one will deselect all others with the same name -- probably what you want -- and the response or the name will be the one you have selected. You can change to a square if you want. In AA9 and such, the form will come up with a choice for the user to highlight all fields, in which case there will be a transparent color (typically light blue) for all fields. You can still see through it. When you select a radio button, the number under it will be hidden by the selected icon -- probably OK to clarify a selection. You could always move it to one side if you want, but I think that is the limit of what you can do. The appearance would be a lot like a scan form you fill in with a #2 pencil (like SATs or GREs).
    I mentioned Designer since many folks get there without realizing it. Looks like you did not make it there, but you might want to explore that option on a copy of your form. Designer also has a separate forum named LiveCycle. The data files produced by AcroForms are typically FDF or XFDF (try exporting your data and look at the file differences). HTML is an option, but not as easy to use. Designer data files are XML files. The FDF, XFDF, and XML files can be imported to the form for printing/viewing/data management if you desire. There is no need to send the entire form, only the data. If you have the whole form sent, then you have to activate Reader Rights for users with Reader and come under the 500 use limit of the license (looks like that might be a problem for you, and the price to get around the limit is not something you really want to ask about unless you are flowing in cash).
    Many folks try to use e-mail for form submission. This is prone to problems of having an e-mail package recognized or the computer setup for MAPI, depending on the version of Acrobat and the OS. It is just a potential problem that can be avoided by a web script submission. Your IT folks should be able to help create a short web script to accept the data file and save it for you. With the FDF toolkit, you can also manipulate the FDF data file to extract what you need to a database or elsewhere. There are a lot of options, but you will likely come upon a few more form issues like the one you asked about that will require a bit of a rethink of how you create the form.
    Hopefully that answers your questions to some extent (even if not directly asked).

  • How to make background of layer transparent so just the object shows up?....

    Hi, I don't know if there's a way to do what I'm trying to but I'm trying to take a jpg picture that I uploaded onto my photoshop elements editor, then using the maze I have on microsoft word to make a maze out of the picture. I was able to paste the maze over the picture by using the over lay option for the 2nd layer and making it more transparent but the lines are getting too transparent also and you can't see some of the lines at all that is over white areas. Is there another way that I can make it so that the lines (of the maze) only show up and make it so the white background is totally transparent?
    I'm also wondering how I can change the whole background color without affecting the picture or anything else. This is my first time playing with the elements editor, I was just thinking I guess I could make a botttom layer and make the layer the color I want or will it bleed through to the other layers or the other layers just cover it up? I really don't know what I'm doing and really don't know about these layers, I'm surprised I was able to do what I did.
    Thank you for any suggestions or help.
    IDK if I'm explaining this right so here is a link to the image.
    Thanks

    With this image, it will be easiest to select the white background.
    1. I would recommend using the Quick Select Tool. Select the white background.
    2. Because you want the lung guy on his own layer not the white background, you need to invert the selection. Select<Inverse.
    3. Copy the lung guy onto his own layer. On PC, press ctrl + J. If on a Mac, the shortcut is cmd + J.
    4. You can now copy/paste lung guy in the desired photo. Alternately, you can drag his layer from the layers palette and drop him into the other document. (If the resolution of lung guy doesn't match your image's resolution, he will shrink or expand as his layer will take on the resolution of the document he is moved into.)
    Note: I would not use the lettering as you can see where the lung guy's image overlaps. It will be an easier project if you redo the lettering in Word or use the Photoshop Element's text tool...maybe with text warp and a layer style....to add the text.

  • How to make a Window object Transparent

    hi all,
    how can i make an object of Window Class transparent.
    please help me out friends.

    This is a transparent window with an orange in it:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.peer.*;
    public class Tw extends JWindow implements FocusListener, MouseMotionListener, MouseListener
         Image     img,tim;
         Graphics  tig;
         Point     mp;
         Robot     r;
    public Tw()
         setBounds(170,170,100,100);
         try
              r = new Robot();
         catch(AWTException awe)
              System.out.println("robot excepton occurred");
         capture();
         addMouseMotionListener(this);
         addMouseListener(this);
         addFocusListener(this);
         setVisible(true);
    public void mouseDragged(MouseEvent m)
         if (mp == null) return;
         Point p = m.getPoint();
         int x = getX()+p.x-mp.x;
         int y = getY()+p.y-mp.y;
         setLocation(x,y);
         paintP(getGraphics());
    public void mouseMoved(MouseEvent m)
    public void mouseClicked(MouseEvent m){}
    public void mouseEntered(MouseEvent m){}
    public void mouseExited(MouseEvent m) {}
    public void mouseReleased(MouseEvent m)
         mp = null;
    public void mousePressed(MouseEvent m)
         mp = m.getPoint();
    public void focusGained(FocusEvent fe)
         setSize(0,0);
         capture();
         setSize(100,100);
    public void focusLost(FocusEvent fe)
    public void capture()
         Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
         img = r.createScreenCapture(new Rectangle(0,0,d.width,d.height));
    public void captureX()
         Rectangle rect = getBounds();
         setVisible(false);
         Thread.yield();
         Image xmg = r.createScreenCapture(rect);
         img.getGraphics().drawImage(xmg,rect.x,rect.y,rect.width,rect.height,null);     
         setLocation(rect.x,rect.y);
         setVisible(true);
    public void paint(Graphics g)
         Rectangle rect = g.getClipBounds();
         if (tim == null)
              tim = createImage(getWidth(),getHeight());
              tig = tim.getGraphics();
         if (!rect.getSize().equals(getSize())) captureX();
              else                               paintP(g);
    public void paintP(Graphics g)
        tig.drawImage(img,0,0,getWidth(),getHeight(),
                           getX(),getY(),getX()+getWidth(),getY()+getHeight(),null);
         tig.setColor(Color.orange);
         tig.fillOval(10,20,70,80);
         tig.setColor(Color.green);
         tig.fillOval(21,16,20,10);
         tig.fillOval(40,02,11,21);
         g.drawImage(tim,0,0,null);
    public void update(Graphics g)
         this.paint(g);
    public static void main (String[] args) 
         new Tw();
    }Noah

  • How to make a BufferedImage background transparent?

    I try to draw an image from a BufferedImage to a JPanel, which the original image background is transparent, but when I draw on the JPanel, its background becomes black color. How can I make it transparent?
    My code is something like this:
    img = Toolkit.getDefaultToolkit().getImage("tiger.gif");
    try {
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(img, 0);
    tracker.waitForID(0);
    } catch (Exception e) {}
    int width = img.getWidth(this);
    int height = img.getHeight(this);
    bImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    bImageG2D= bImage.createGraphics();
    bImageG2D.drawImage(img, 0, 0, null);
    public void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g2.drawImage(bImage, 0, 0, null);
    Thanks for the help!

    Nekot,
    It would be a great help if you can share your code of 'transparent bufferedimage' with me. I have been trying to create a transparent gif since long. Now I think I can create a transparent bufferedimage and display it.
    Thanks,
    Riddhi.

  • How to make animations float with transparent background

    I am taking a graduate course in adv. web design for an ed
    tech program at a university. Neither my instructor nor anyone else
    in my class knows how to get Flash animations to have a transparent
    background, or even if this is possible. On behalf of us all, I am
    wondering if it is possible to create a Flash animation without a
    background--or with a transparent background, and then superimpose
    it onto a web page so that the web page's background shows through
    all but the animated part. We are using Flash 8. If it is possible,
    can someone please tell us how to do it? I have seen web pages
    where the animations float over the web page. Are these animations
    made with Flash or with another program? Thank you!

    Yes, it's easy, but haven't done it for a while, and not
    since all the new ActiveX stuff on MS IE requires Java Script to
    make the dotted outline go away.
    To do it well takes a combination of Flash with the
    publish-settings HTML Window Mode set to Transparent Windowless,
    and tightly-designed CSS with your animation positioned in a div
    that lies or overlays the exact place on the HTML page where you
    want it. You can even have it scale to the entire visible window,
    which can be quite cool. I did one for the holidays with snow
    falling over an HTML page. It can block lnks from working, though,
    so you can have the div (and animation) disappear when the
    animation is done.

  • How to make one area less transparent?

    I have an object set to 60% opacity.  I have a text box layered on top of that with white text.  I would the object to be LESS transparent (90%opacity) where it lies under the text box. How can I do this?  thank you.

    Like Peter says, you can duplicate the object, reduce or adjust the shape to sit where you want it less transparent, set it to 30% opacity and maybe add a basic feather so there isn't a hard edge. Or you could try using a  gradient feather within the object and adjust the sliders to suit, but this might be less precise.

  • How to make white colored sections transparent

    I have made a logo that consists of a black circle, with lots of text and shapes inside that are colored white. It looks fine on a white background, but when you change the background color the text stays white, when I want it to be transparent like a "cut out". How can I achieve this easily and still be able to edit the text?

    Thanks Jacob! This worked. I already tried clipping masks and pathfinder but they didn't work very well because I used strokes around the white shapes. Not sure about knockout groups, but it did what I wanted.

  • Anyone figure out how to make a Flash w/transparent bkgnd yet?

    It's been a while since I tried my hand at developing Flash animations that I could drop into a Keynote presentation. My big disappointment when I tried a year or so ago was that you couldn't export the animation in such a way as to play in Keynote with a transparent background. Best you could do as far as transparency went was some sort of HTML export and only in the Windows version. Or some such madness.
    Anyway, it would be great to be able to create animations (as slick as Flash can make them) that would play in KYN.
    Anyone have a nice solution (maybe even non-Flash)?
    PowerBook (15" Al PBG4)   Mac OS X (10.4.5)  

    Anyone know if Flash Pro 8 has improved the transparent background issue? We used to be able to put a man on the moon. So much computing power later we can't have simple animations with transparent backgrounds?
    I hope I'm not the only one who wants to be able to generate a Flash-style animation with a transparent background that I could drop into a Keynote presentation.
    My hat's off to Kyn for finding a way (there was a will)!
    I'm hoping for a simpler solution. Maybe there's just no demand for this feature, or it's hugely difficult to code.
    In the meantime, I'll keep trying to pound Keynote's animation set into something I can use.

Maybe you are looking for

  • Implementing the Enterprise Support in Solution Manager

    Hi Experts, Can anybody tell me what are the pre requisites to implement Enterprise support in solution manager? Also let me know what are steps involved in implementing the enterprise support. Thanks in Advance Hari

  • Create new sub-element (Service reference) SICF

    Hello Friends, I have created a new BSP extension. Now i want to add this into SICF...as a sub element... while trying to do this...it is throwing a error that "no authorization"... My user is having "SAP_ALL" profile too... Please help me, what are

  • Service error - ECC_EMPTIMSHEETCHGRC - XML Serialization Error

    I am not able to execute the service - EmployeeTimeSheetChangeRequestConfirmation_In (http://<host:port>/sap/bc/srt/xip/sap/ECC_EMPTIMSHEETCHGRC?sap-client=<number>&wsdl=1.1&mode=sap_wsdl) in the discovery system. I am getting the following error - X

  • Battery Percentage not showing up in iOS8

    Every time I try to turn it on in settings > general > usage nothing shows beside the battery bar in the corner. Anyone else having this problem?

  • Date & Time error 0271 with T-22

    I've had no problems with my T-22 which was upgraded to Windows XP and additional RAM was added about a year ago. It's been running fine and had no problems until about a week ago. When I went to turn it on I got an error 0271 "check date and time se