Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:46:24+00:00 2026-06-07T20:46:24+00:00

Here is a chair i created using blender: Now, when i display it using

  • 0

Here is a chair i created using blender:

enter image description here

Now, when i display it using Java3D this is what i get:

enter image description here

Why is my texture not showing up in java? Here is my code for displaying the chair:

package com;

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;

import javax.media.j3d.Alpha;
import javax.media.j3d.Appearance;
import javax.media.j3d.Background;
import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import javax.media.j3d.DirectionalLight;
import javax.media.j3d.RotationInterpolator;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3f;

import com.microcrowd.loader.java3d.max3ds.Loader3DS;
import com.sun.j3d.loaders.Scene;
import com.sun.j3d.loaders.objectfile.ObjectFile;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;

public class LoadAnObject extends Applet
{
    public LoadAnObject()
    {
        setLayout(new BorderLayout());
        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas = new Canvas3D(config);
        add("Center", canvas);

        BranchGroup content = getScene();
        content.compile();

        SimpleUniverse universe = new SimpleUniverse(canvas);
        universe.getViewingPlatform().setNominalViewingTransform();
        universe.addBranchGraph(content);
    }

    public BranchGroup getScene()
    {
        BranchGroup group = new BranchGroup();

        Loader3DS loader = new Loader3DS();

        Scene scene = null;

        try
        {
            scene = loader.load("/Users/John/ArtOfIllusion/Chair.3ds");
        }catch(Exception e){e.printStackTrace();}

        TransformGroup rotateGroup = new TransformGroup();
        Transform3D rotate = new Transform3D();
        rotate.rotX(- Math.PI / 8);
        rotateGroup.setTransform(rotate);
        rotateGroup.addChild(scene.getSceneGroup());

        TransformGroup objSpin = new TransformGroup();
        objSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        //objSpin.addChild(new ColorCube(.5));
        Alpha rotationAlpha = new Alpha(-1, 4000);
        RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objSpin);

        BoundingSphere boundSphere = new BoundingSphere(new Point3d(0.0f, 0.0f, 0.0f), 200);
        rotator.setSchedulingBounds(boundSphere);
        objSpin.addChild(rotator);
        objSpin.addChild(rotateGroup);

        TransformGroup moveGroup = new TransformGroup();
        Transform3D move = new Transform3D();
        move.setTranslation(new Vector3f(0.0f, 0.0f, -20.0f));
        moveGroup.setTransform(move);
        moveGroup.addChild(objSpin);

        group.addChild(moveGroup);

        Background background = new Background(0.0f, 1.0f, 1.0f);
        background.setApplicationBounds(new BoundingSphere());
        group.addChild(background);

        Color3f light1Color = new Color3f(1.0f, 1.0f, 1.0f);
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
        Vector3f light1Direction = new Vector3f(0, 0, 10);
        DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
        light1.setInfluencingBounds(bounds);
        group.addChild(light1);

        return group;
    }

    public static void main(String args[])
    {
        Frame frame = new MainFrame(new LoadAnObject(), 256, 256);
    }
}

The file format I’m using is .3ds, here is where i got the loader from:

  • http://sourceforge.net/projects/java3dsloader/

How do i get the texture of the chair to show up in java?


edit:

I compiled my chair into a .3ds file instead of an object file, i now have to use a .3ds loader which i got from here:

  • http://sourceforge.net/projects/java3dsloader/

The code doesn’t change too much, instead of using an ObjectFile i now use a Loader3DS

enter image description here

So now obviously you can see that the material transferred over, but not the texture, how do i get the texture to show up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:46:26+00:00Added an answer on June 7, 2026 at 8:46 pm

    Java apparently doesn’t load textures unless they are generated from an image. The only way I’ve been able to load textures is from an image mapped texture. I’ve tried a couple different formats and i still got nothing. If you are going to try to use textures in Java3D make sure you use Image Mapped textures!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Spring Framework here... I created a filter to change the response body of
I have written this piece of code here and I have linked it alright
I have created a code in C++ that is supposed to display an O
I'm try to do this : I'm using EF code first to map an
Here is my code: void subroutine(const char *message) { printf(message); } And here is
Here's the code snippet: public static void main (String[]arg) { char ca = 'a'
where is the mistake? My code here: typedef struct _box { char *dados; struct
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
I've been trying to figure this out for hours now, and I'm at my
I created a key and a csr on console, using the openssl executable. Then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.