Welcome to Dream.In.Code
Become an Expert!

Join 149,613 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,848 people online right now. Registration is fast and FREE... Join Now!




java 3d programming help

 
Reply to this topicStart new topic

java 3d programming help, Texture...

RautRupali
20 Sep, 2007 - 09:11 PM
Post #1

New D.I.C Head
*

Joined: 7 Jun, 2007
Posts: 44


My Contributions
Hi All,

I m using following code to display textures along x,y and z axis in a cube.there are 55 textures. I m displaying them in a cube to create 3D image. Each image contain red and black color.

CODE


String imagename="C:\\DICOMimages\\ii\\ii00" + i + ".gif";
File file = new File(imagename);

BufferedImage bImage1 =new BufferedImage( 128,128,BufferedImage.TYPE_INT_ARGB);  
        try
           {
        bImage1 = ImageIO.read( file );
           }
        catch ( IOException e )
           {
           System.out.println( "image missing" );
           }
        
            
Texture2D tex;
ImageComponent2D pArray;
tex = new Texture2D(Texture.BASE_LEVEL,Texture.INTENSITY, 128, 128);
       pArray = new ImageComponent2D(ImageComponent.FORMAT_CHANNEL8, 128, 128);
         pArray.set(bImage1);           tex.setImage(0, pArray);
tex.setEnable(true);
tex.setMinFilter(tex.BASE_LEVEL_LINEAR);
tex.setMagFilter(tex.BASE_LEVEL_LINEAR);
      
tex.setBoundaryModeS(tex.CLAMP);
tex.setBoundaryModeT(tex.CLAMP);

textures[i] = tex;



ii00 is a red and black colored image. If I use Texture.INTENSITY the images are displayed in gray and white color.and 3D model created. But i want colored 3D model.

I use Texture.RGBA instead of Texture.INTENSITY

But it is displaying only first and last images in red and black color.

What i have to do for displaying the same model in red color..

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 12:23AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month