Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (788)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (863)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  HELP! Textures  (Read 2352 times)
0 Members and 1 Guest are viewing this topic.
Offline adzadz

Junior Newbie

Java games rock!

« Posted 2003-03-15 19:14:24 »

How do i use more than one texture. I want to put a different texture on each side of a cube.  Any elp is greatly appreciated
Offline Breakfast

Senior Devvie

for great justice!

« Reply #1 - Posted 2003-03-15 21:26:44 »

I don't know about this for certain but I think you need to either break your cube up into six faces ( just creating a basic "face" class that extends Shape3D ) and give each one it's own texture or to create a texture that wraps around the different faces of the cube so it looks different on each one. You may even be able to do something really clever with texture-co-ordinates setting them for each face so that an image that is just a strip of textures can be mapped to different faces using it's co-ordinates. I'm rather thinking on my feet here, though and I wouldn't like to try and think through the code for that one...
Offline fnadeauLM

Innocent Bystander

Java games rock!

« Reply #2 - Posted 2003-04-04 18:25:00 »


If you are using a com.sun.j3d.utils.geometry.Box you can do the following:

//----------------------------------------------------------------------- Create the Box
Box myBox = new Box(1.0f, 1.0f, 1.0f, Primitive.GENERATE_TEXTURE_COORDS,
                   new Appearance());

Appearance frontAppearance = new Appearance();
TextureLoader loader = new TextureLoader(this.getClass().getResource("../images/C006BASZOM.jpg"), canvas);

//----------------------------------------------------------------------- For each texture
Appearance frontAppearance = new Appearance();
//----------------------------------------------------------------------- Place the textures

Hope this help,
Pages: [1]
  ignore  |  Print  

hadezbladez (2209 views)
2018-11-16 13:46:03

hadezbladez (833 views)
2018-11-16 13:41:33

hadezbladez (2165 views)
2018-11-16 13:35:35

hadezbladez (433 views)
2018-11-16 13:32:03

EgonOlsen (3472 views)
2018-06-10 19:43:48

EgonOlsen (3725 views)
2018-06-10 19:43:44

EgonOlsen (2285 views)
2018-06-10 19:43:20

DesertCoockie (3021 views)
2018-05-13 18:23:11

nelsongames (3095 views)
2018-04-24 18:15:36

nelsongames (3911 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!