Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 01:46:19 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Split a TextureImage2D
Pages: [1]
Print
Author Topic: Split a TextureImage2D  (Read 279 times)
davicente
Just dropped in

Offline Offline

Posts: 10


View Profile
« on: 05. April 2010, 08:38:46 am »

Hi everyone:

I have a difficult problem to solve.
I have a Shape3D object (with his TextureImage2D and his Geometry). The TextureImage2D is loaded from an image file. I need to get a BufferedImage to each part of the Shape3D object or to each Triangle of the shape. I only can get the BufferedImage from all the image file.
May be some option to get differents images from the original image file using the texture coordinates? I can´t find any way to do that

Thanks
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #1 on: 05. April 2010, 01:13:02 pm »

I do not believe there is a way to do what you are asking using the Xith3D API.  You can load the image using AWT methods and split the BufferedImage into rectangles which can each be used to create Textures.  Mapping between rectangular textures and geometry is always a problem, but it is imposed by the graphics card APIs; i.e., graphics cards expect all textures to be rectangular with a coordinate mapping onto geometry.

If the above does not do enough for you, then you will need to load the image into a graphics program and "fix it".
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
davicente
Just dropped in

Offline Offline

Posts: 10


View Profile
« Reply #2 on: 05. April 2010, 01:29:47 pm »

I´m going to try it. Thanks for the answer.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic