Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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 2108 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  

xxMrPHDxx (332 views)
2017-12-31 17:17:51

xxMrPHDxx (109 views)
2017-12-31 17:15:51

xxMrPHDxx (158 views)
2017-12-28 18:11:33

Ecumene (340 views)
2017-09-30 02:57:34

theagentd (504 views)
2017-09-26 18:23:31

cybrmynd (548 views)
2017-08-02 12:28:51

cybrmynd (487 views)
2017-08-02 12:19:43

cybrmynd (461 views)
2017-08-02 12:18:09

Sralse (423 views)
2017-07-25 17:13:48

Archive (1346 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!