Trouble loading .OBJ model

Hello all,
I can't seem to load a .OBJ model with this code. The code is not returning any exceptions, but the window gives me nothing but a black screen. The model is nothing more than a cube, and I am entering a valid file location.
public class Model3d
    private String location;
    private SceneBase s;
    public Model3d(String fileLocation)
        location = fileLocation;
        s = (SceneBase)getScene();
    public SceneBase getSceneBase()
          TransformGroup tg = new TransformGroup();
          Transform3D transform = new Transform3D();
          Vector3f vector = new Vector3f(0, 0, 0);
          transform.setTranslation(vector);
          tg.setTransform(transform);
          s.addViewGroup(tg);
          return s;
    private Scene getScene()
        try
            ObjectFile of = new ObjectFile(ObjectFile.RESIZE);
            Scene s = of.load(new FileReader(location));
            return s;
        catch(java.io.FileNotFoundException e)
            System.out.println("lol");
            e.printStackTrace();
            return null;
}When I call:
su = new SimpleUniverse();
BranchGroup group = new BranchGroup();
group.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
group.addChild(new Model3d("C:\\square.obj").getSceneBase().getSceneGroup());
su.getViewingPlatform().setNominalViewingTransform();
su.addBranchGraph(group);I get a black screen. Help? Thanks in advance.

Hi,
Sorry for the delay
I found this at Java Tips and changed it to work on my computer. Just change dlamp.obj (appears once) to square.obj. I think it'll work if you place the file in the same folder as your java file as well as the C:// drive.
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.GraphicsConfiguration;
import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.media.j3d.Alpha;
import javax.media.j3d.AmbientLight;
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.sun.j3d.loaders.IncorrectFormatException;
import com.sun.j3d.loaders.ParsingErrorException;
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.behaviors.vp.OrbitBehavior;
import com.sun.j3d.utils.universe.PlatformGeometry;
import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.universe.ViewingPlatform;
public class ObjLoad extends Applet {
private boolean spin = false;
private boolean noTriangulate = false;
private boolean noStripify = false;
private double creaseAngle = 60.0;
private URL filename = null;
private SimpleUniverse u;
private BoundingSphere bounds;
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
// Create a Transformgroup to scale all objects so they
// appear in the scene.
TransformGroup objScale = new TransformGroup();
Transform3D t3d = new Transform3D();
t3d.setScale(0.7);
objScale.setTransform(t3d);
objRoot.addChild(objScale);
// Create the transform group node and initialize it to the
// identity. Enable the TRANSFORM_WRITE capability so that
// our behavior code can modify it at runtime. Add it to the
// root of the subgraph.
TransformGroup objTrans = new TransformGroup();
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
objScale.addChild(objTrans);
int flags = ObjectFile.RESIZE;
if (!noTriangulate)
flags |= ObjectFile.TRIANGULATE;
if (!noStripify)
flags |= ObjectFile.STRIPIFY;
ObjectFile f = new ObjectFile(flags,
(float) (creaseAngle * Math.PI / 180.0));
Scene s = null;
try {
s = f.load(filename);
} catch (FileNotFoundException e) {
System.err.println(e);
System.exit(1);
} catch (ParsingErrorException e) {
System.err.println(e);
System.exit(1);
} catch (IncorrectFormatException e) {
System.err.println(e);
System.exit(1);
objTrans.addChild(s.getSceneGroup());
bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
if (spin) {
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE, 0, 0,
4000, 0, 0, 0, 0, 0);
RotationInterpolator rotator = new RotationInterpolator(
rotationAlpha, objTrans, yAxis, 0.0f,
(float) Math.PI * 2.0f);
rotator.setSchedulingBounds(bounds);
objTrans.addChild(rotator);
// Set up the background
Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
Background bgNode = new Background(bgColor);
bgNode.setApplicationBounds(bounds);
objRoot.addChild(bgNode);
return objRoot;
private void usage() {
System.out
.println("Usage: java ObjLoad [-s] [-n] [-t] [-c degrees] <.obj file>");
System.out.println(" -s Spin (no user interaction)");
System.out.println(" -n No triangulation");
System.out.println(" -t No stripification");
System.out
.println(" -c Set crease angle for normal generation (default is 60 without");
System.out
.println(" smoothing group info, otherwise 180 within smoothing groups)");
System.exit(0);
} // End of usage
public void init() {
if (filename == null) {
// Applet
try {
               filename = new URL("file","","dlamp.obj");
} catch (MalformedURLException e) {
System.err.println(e);
System.exit(1);
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse
.getPreferredConfiguration();
Canvas3D c = new Canvas3D(config);
add("Center", c);
// Create a simple scene and attach it to the virtual universe
BranchGroup scene = createSceneGraph();
u = new SimpleUniverse(c);
// add mouse behaviors to the ViewingPlatform
ViewingPlatform viewingPlatform = u.getViewingPlatform();
PlatformGeometry pg = new PlatformGeometry();
// Set up the ambient light
Color3f ambientColor = new Color3f(0.1f, 0.1f, 0.1f);
AmbientLight ambientLightNode = new AmbientLight(ambientColor);
ambientLightNode.setInfluencingBounds(bounds);
pg.addChild(ambientLightNode);
// Set up the directional lights
Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
DirectionalLight light1 = new DirectionalLight(light1Color,
light1Direction);
light1.setInfluencingBounds(bounds);
pg.addChild(light1);
DirectionalLight light2 = new DirectionalLight(light2Color,
light2Direction);
light2.setInfluencingBounds(bounds);
pg.addChild(light2);
viewingPlatform.setPlatformGeometry(pg);
// This will move the ViewPlatform back a bit so the
// objects in the scene can be viewed.
viewingPlatform.setNominalViewingTransform();
if (!spin) {
OrbitBehavior orbit = new OrbitBehavior(c,
OrbitBehavior.REVERSE_ALL);
BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0,
0.0), 100.0);
orbit.setSchedulingBounds(bounds);
viewingPlatform.setViewPlatformBehavior(orbit);
u.addBranchGraph(scene);
// Caled if running as a program
public ObjLoad(String[] args) {
if (args.length != 0) {
for (int i = 0; i < args.length; i++) {
if (args.startsWith("-")) {
if (args[i].equals("-s")) {
spin = true;
} else if (args[i].equals("-n")) {
noTriangulate = true;
} else if (args[i].equals("-t")) {
noStripify = true;
} else if (args[i].equals("-c")) {
if (i < args.length - 1) {
creaseAngle = (new Double(args[++i])).doubleValue();
} else
usage();
} else {
usage();
} else {
try {
if ((args[i].indexOf("file:") == 0)
|| (args[i].indexOf("http") == 0)) {
filename = new URL(args[i]);
} else if (args[i].charAt(0) != '/') {
filename = new URL("file:./" + args[i]);
} else {
filename = new URL("file:" + args[i]);
} catch (MalformedURLException e) {
System.err.println(e);
System.exit(1);
// Running as an applet
public ObjLoad() {
public void destroy() {
u.cleanup();
// The following allows ObjLoad to be run as an application
// as well as an applet
public static void main(String[] args) {
new MainFrame(new ObjLoad(args), 700, 700);

Similar Messages

  • Loading .obj model file to applet returns AccessControlException

    I examined other applets where this code seems to work. Yet, I can't get it to function properly within my code.
         URL fileURL = null;
            try {
             fileURL = new URL( getDocumentBase(), "test.obj");
            } catch (Exception e) {
             System.err.println("Exception: "+ e);
             System.exit(1);
            ObjectFile f = new ObjectFile();
            Scene s = null;
            try {
                s = f.load( fileURL );
            catch (Exception e) {
                System.err.println(e);
                System.exit(1);
            }I can load image files without any problems. Any help will be appreciated.

    Forgot to post the error message..
    java.security.AccessControlException: access denied (java.io.FilePermission /home/squier/cwol/html/test.obj read)
    java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkExit(SecurityManager.java:744)
         at java.lang.Runtime.exit(Runtime.java:88)
         at java.lang.System.exit(System.java:868)
         at cwol.BattleApp.loadModel(BattleApp.java:157)
         at cwol.BattleApp.init(BattleApp.java:63)
         at sun.applet.AppletPanel.run(AppletPanel.java:374)
         at java.lang.Thread.run(Thread.java:595)

  • Is it possible to make a morph between loaded 3d-models?

    I want to load obj-models and then make a morph between them. It's seems like it is not possible in Java3D. Or am I wrong?
    A morph is made from GeometryArrays which come from shape3d-object. It is possible to get a scene from the loaded model with the load() method in the ObjectFile class. But is it also possible to exctract a geometryarray from the model, so a morph can be made?
    Check out the morphs that I already have:
    http://www.astralvisuals.com/ShapeShiftersnew.htm

    It's not easy but it's possible:
    At first you have to decide which vertex_1 from model 1 has to fade into which vertex_2 from model 2 (To decide this just check the distance).
    If the two models don't have the same vertex amout just let the model with more vertexes fade into that with the lower amout of vertexes and than invert the animation if needed.
    After this is done you just have to move the vertexes from frame to frame from the old position to the new position.
    This is how to morph models but I don't know how to morph textures :-/

  • Loading OBJ-File BY COPY ?

    Hello!
    I want to load a 3D-Model in OBJ-Format in my Scene with the standard Objectloader com.sun.j3d.loaders.objectfile. This works basically well.
    But I need to get hold of the Vertices of the Model and their colors. And this is the Problem:
    -I try to get the Coordinates from the Shape3Ds GeometryArray with getCoordinate() and receive the following error:
    GeometryArray: cannot directly access data in BY_REFERENCE mode
    This is as I assume because the loader creates the Shape3D BY REFERENCE.
    Is there another loader or a trick, so that the GeometryArrays of my loaded OBJ-Models are set up as BY COPY?
    Code where I load my Model:
    public BranchGroup UseOBJModel_Old(String path)
            ObjectFile loader = new ObjectFile();
            BranchGroup bg = new BranchGroup();
            Shape3D shape = new Shape3D();
            try
                Scene tmpScene = loader.load(path);
                 Enumeration children = tmpScene.getSceneGroup().getAllChildren();
                //Combining all Shape3Ds from the OBJ-Model into one single shape
                while(children.hasMoreElements())
                     Shape3D tmp = (Shape3D)children.nextElement();
                     shape.addGeometry(tmp.getGeometry());      
                //TODO: Hard setting of Color for OBJ-Shape.Can be improved later
                Appearance objApp = new Appearance();
                Material objMat = new Material();
                ColoringAttributes col = new ColoringAttributes();
                objMat.setAmbientColor(new Color3f(.3f,.3f,.3f));
                objMat.setDiffuseColor(new Color3f(.5f,.5f,.5f));
                objMat.setSpecularColor(new Color3f(.6f,.6f,.6f));
                objMat.setLightingEnable(true);
                objApp.setMaterial(objMat);
                objApp.setColoringAttributes(col);
                col.setColor(.6f,.6f,.6f);
                shape.setAppearance(objApp);
                bg.addChild(shape);
                return bg;
            }Code where the Error occurs:
    for(int j = 0; j < originalArray.getValidVertexCount() / divisor; j++)//Calculate Points for LOD-Models
                for(int k = 0; k < divisor; k++ )
                   // This tells me that the Array is NOT in BY REFERENCE-Mode. Funny thing
                    System.out.println("By-Reference-Status: " + originalArray.getCapability(GeometryArray.BY_REFERENCE));
                   originalArray.getColor(index,col[k]);//Here's the Error
                   originalArray.getCoordinate(index++,pos[k]);//And here,too
            }Hope I could make it clear what my Problem is, as this is my first post here...
    Bye
    Chris

    D'Oh!
    First post, and already posted the wrong code...
    This is the right code, where I load the OBJ-Model:
    public void UseOBJModel(String path)
            ObjectFile loader = new ObjectFile();
            Shape3D shape = new Shape3D();
            try
                Scene tmpScene = loader.load(path);
                 Enumeration children = tmpScene.getSceneGroup().getAllChildren();
                 Shape3D tmp = (Shape3D)children.nextElement();
                 shape.setGeometry(tmp.getGeometry(),0);//This for killing the leading null in the GeometryList
                //Combining all Shape3Ds from the OBJ-Model into one single shape
                while(children.hasMoreElements())
                    tmp = (Shape3D)children.nextElement();
                     shape.addGeometry(tmp.getGeometry());      
                //TODO: Hard setting of Color for OBJ-Shape.Can be improved later
                Appearance objApp = new Appearance();
                Material objMat = new Material();
                ColoringAttributes col = new ColoringAttributes();
                objMat.setAmbientColor(new Color3f(.3f,.3f,.3f));
                objMat.setDiffuseColor(new Color3f(.5f,.5f,.5f));
                objMat.setSpecularColor(new Color3f(.6f,.6f,.6f));
                objMat.setLightingEnable(true);
                objApp.setMaterial(objMat);
                objApp.setColoringAttributes(col);
                col.setColor(.6f,.6f,.6f);
                shape.setAppearance(objApp);
                SetOriginalShape(shape);
            catch(FileNotFoundException e)
                System.err.println("Something went wrong while loading OBJ-File");
        }Sorry...

  • I am having trouble loading games to my ipod touch version 2.2.1, model MB531LL...how do I get IOS 4.3 or 5?

    I am having trouble loading games to my ipod touch version 2.2.1, model MB531LL...how do I get IOS 4.3 or 5?  How do I tell which operating system I have?  is it 2.2.1 = " the version"?   I am clueless....please help!!  Thanks!! 

    You have a 2G iPod those can only go to 4.2.1.
    Connect the iPod to your computer and update via iTunes
    iOS: How to update your iPhone, iPad, or iPod touch
    A 2G to 4.2.1. Requires iTunes version 10.X. If a Mac it requires OSX 10.5.8 or later.
    Identifying iPod models

  • LOAD VILLA MODEL WITH TEXTURES

    HI FOR ALL
    FIRST I HAVE A PROBLEM IN MY GRADUATION PROJECT I WANT TO LOAD A 3D VILLA MODELS WITH TEXTURES
    I LOADED MODELS BUT TEXTURES DID NOT APPEAR PLEASE CAN ANY ONE HELP ME
    SECOND I WANT TO PUT THE JAVA 3D APPLET ON A WEBSITE HOW CAN I PUT THE J3D APPLET IN HTML DOC ??

    This is my appleT
    {code */
    public class OnAppletView extends Applet {
        public BranchGroup createSceneGraph(SimpleUniverse su) throws MalformedURLException {
    //        String objUrl="";
    //         Connection conn=null;
    //          String UserName="root";
    //          String Password="password";
    //          String Url="jdbc:mysql://localhost/City";
    //                ResultSet rs=null;
    //                try
    //          Class.forName("com.mysql.jdbc.Driver").newInstance();
    //          conn=DriverManager.getConnection(Url,UserName,Password);
    //          System.out.println("Database connection established");
    //          Statement s=conn.createStatement();
    //          s.executeQuery("select url from resources where obj1='villa' ");
    //          rs=s.getResultSet();
    //                if(rs!=null)
    //              try
    //              while(rs.next())
    //                   objUrl=rs.getString(1);
    //                        System.out.println("objjjj"+objUrl);
    //          catch (Exception e) {
    //                    // TODO: handle exception
    //               e.printStackTrace();
    //          s.close();
    //          conn.close();
    //          System.out.println("DB Connection terminated");
    //          catch (Exception e) {
    //               e.printStackTrace();
    // Create the root of the branch graph
    TransformGroup vpTrans = null;
    BranchGroup objRoot = new BranchGroup();
    ObjectFile f = new ObjectFile(ObjectFile.RESIZE | ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY );
    Scene s = null;
    try {
    // f.setBaseUrl( new URL("file:///"));
    // s = f.load(new URL("file:///C:/Users/Mido/Desktop/ObjectLoader/villa1/villa1.obj"));
    // f.setBaseUrl(new URL("file:///C:/Users/Mido/Desktop/OBJ-Models/Unterstand&Carport/"));
    // s = f.load(new URL("file:///C:/Users/Mido/Desktop/OBJ-Models/house/casa1/casa1.obj"));
    f.setBasePath("C:\\Users\\Mido\\Desktop\\NewVilla\\");
    s = f.load("C:\\Users\\Mido\\Desktop\\NewVilla\\House02b.obj");
    } catch (FileNotFoundException e) {
    System.err.println(e);
    System.exit(1);
    } catch (ParsingErrorException e) {
    System.err.println(e);
    System.exit(1);
    } catch (IncorrectFormatException e) {
    System.err.println(e);
    System.exit(1);
    /// objRoot.addChild(s.getSceneGroup());
    Vector3f translate = new Vector3f();
    Transform3D T3D = new Transform3D();
    TransformGroup TG = null;
    SharedGroup share = new SharedGroup();
    share.addChild(s.getSceneGroup());
    float[][] position = {{0.0f, -0.1f, -3.0f},
    {6.0f, -0.1f, 0.0f},
    {6.0f, -0.1f, 6.0f},
    {3.0f, -0.1f, -10.0f},
    {13.0f, -0.1f, -30.0f},
    {-13.0f, -0.1f, 30.0f},
    {-13.0f, -0.1f, 23.0f},
    {13.0f, -0.1f, 3.0f}};
    for (int i = 0; i < position.length; i++) {
    translate.set(position);
    T3D.setTranslation(translate);
    TG = new TransformGroup(T3D);
    TG.addChild(new Link(share));
    objRoot.addChild(TG);
    vpTrans = su.getViewingPlatform().getViewPlatformTransform();
    translate.set(0.0f, 0.3f, 0.0f);
    T3D.setTranslation(translate);
    vpTrans.setTransform(T3D);
    KeyNavigatorBehavior keyNavBeh = new KeyNavigatorBehavior(vpTrans);
    keyNavBeh.setSchedulingBounds(new BoundingSphere(new Point3d(), 1000.0));
    objRoot.addChild(keyNavBeh);
    objRoot.compile();
    return objRoot;
    } // end of CreateSceneGraph method of KeyNavigatorApp
    public void init() {
    // TODO start asynchronous download of heavy resources
    setLayout(new BorderLayout());
    GraphicsConfiguration config =
    SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas3D = new Canvas3D(config);
    add("Center", canvas3D);
    // SimpleUniverse is a Convenience Utility class
    SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
    BranchGroup scene=null;
    try {
    scene = createSceneGraph(simpleU);
    } catch (MalformedURLException ex) {
    Logger.getLogger(OnAppletView.class.getName()).log(Level.SEVERE, null, ex);
    // LIGHT
    AmbientLight ambientLight = new AmbientLight(new Color3f(Color.black));
    ambientLight.setInfluencingBounds(new BoundingSphere(new Point3d(), 100.0));
    DirectionalLight directionalLight = new DirectionalLight(new Color3f(Color.WHITE), new Vector3f(0.0f, 0.0f, -1.0f));
    directionalLight.setInfluencingBounds(new BoundingSphere(new Point3d(), 100.0));
    BranchGroup lightingBG = new BranchGroup();
    lightingBG.addChild(ambientLight);
    lightingBG.addChild(directionalLight);
    PlatformGeometry platformGeometry = new PlatformGeometry();
    platformGeometry.addChild(lightingBG);
    simpleU.getViewingPlatform().setPlatformGeometry(platformGeometry);
    //END OF LIGHT
    // This will move the ViewPlatform back a bit so the
    // objects in the scene can be viewed.
    simpleU.getViewingPlatform().setNominalViewingTransform();
    // TO INTERACT WITH MOUSE
    // OrbitBehavior orbitBehavior = new OrbitBehavior(canvas3D , OrbitBehavior.REVERSE_ALL);
    // orbitBehavior.setBoundsAutoCompute(true);
    // orbitBehavior.setSchedulingBounds(new BoundingSphere(new Point3d() , 100.0));
    // simpleU.getViewingPlatform().setViewPlatformBehavior(orbitBehavior);
    simpleU.addBranchGraph(scene);
    // TODO overwrite start(), stop() and destroy() methods
    i wanT To implemenT a collision detection to prevent the viewer to walk through the wall what can i do ? there is a class ??                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Loading .obj and .mtl in Java, how I can do this?

    Well, I'm having problem with this, I'm doing my Course Conclusion Work related with augmented reality in java (JARToolKit) and I want to import models 3D in the format .obj, but I need to import it's materials too that is in the file .mtl. Anyone that already use this or do this if can help me I will be grateful, I need this and I trying everything, any help will be very good to me.
    Thanks,
    Jairo.

    Hi,
    the Java 3D API includes a utility for loading '.obj/.mtl'-files: com.sun.j3d.loaders.objectfile.ObjectFile.
    August

  • Can't set Shade GOURAUD on imported Obj models

    Hi,
    I'm importing an obj model, but I can't get the shading model to be Gouraud. It's always flat.
    Here is a short code snippet where I try to make the model use Gouraud shading:
    ObjectFile objectFile = new ObjectFile();
    Scene scene = null;
    try {
    scene = objectFile.load(filepath);
    (...) // catch block
    Hashtable allReferences = scene.getNamedObjects();
    Enumeration enumeration = allReferences.keys();
    while (enumeration.hasMoreElements()) {
    String key = (String) enumeration.nextElement();
    Appearance appearance = new Appearance();
    ColoringAttributes coloringAttributes = new ColoringAttributes();
    coloringAttributes.setShadeModel(ColoringAttributes.SHADE_GOURAUD);
    appearance.setColoringAttributes(coloringAttributes);
    Material material = new Material();
    material.setDiffuseColor(1f, 1f, 1f);
    appearance.setMaterial(material);
    if (allReferences.get(key) instanceof Shape3D) {
    Shape3D ref = (Shape3D) allReferences.get(key);
    ref.setCapability(Shape3D.ALLOW_APPEARANCE_OVERRIDE_WRITE);
    ref.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
    ref.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
    ref.setCapability(Shape3D.ALLOW_APPEARANCE_OVERRIDE_READ);
    ref.setAppearance(appearance);
    Thanks in advance

    I think this is the culprit:
    3) check the key of the imported file with a software instrument, and switch the project's key accordingly
    If the "follow tempo & pitch" box is checked, this might change the sample's pitch and throw GB off.
    Try to determine the sample's key before you import it, set the GB project's key accordingly, and then import the sample. That should assign it the correct key!

  • Loading Obj file with its .mtl

    Hai guys,
    I am new to java3D. I need to load the .obj which has the .mtl and the respective pics for its texture.(The .obj file .mtl and the relevant pics are all in the same folder) The Problem is obj file is being loaded but the output we got is no where near what we see in 3DMax. What is the problem?. Where i am going wrong.
    Thanks in Advance,
    Prakash Anandaraj. C

    D'Oh!
    First post, and already posted the wrong code...
    This is the right code, where I load the OBJ-Model:
    public void UseOBJModel(String path)
            ObjectFile loader = new ObjectFile();
            Shape3D shape = new Shape3D();
            try
                Scene tmpScene = loader.load(path);
                 Enumeration children = tmpScene.getSceneGroup().getAllChildren();
                 Shape3D tmp = (Shape3D)children.nextElement();
                 shape.setGeometry(tmp.getGeometry(),0);//This for killing the leading null in the GeometryList
                //Combining all Shape3Ds from the OBJ-Model into one single shape
                while(children.hasMoreElements())
                    tmp = (Shape3D)children.nextElement();
                     shape.addGeometry(tmp.getGeometry());      
                //TODO: Hard setting of Color for OBJ-Shape.Can be improved later
                Appearance objApp = new Appearance();
                Material objMat = new Material();
                ColoringAttributes col = new ColoringAttributes();
                objMat.setAmbientColor(new Color3f(.3f,.3f,.3f));
                objMat.setDiffuseColor(new Color3f(.5f,.5f,.5f));
                objMat.setSpecularColor(new Color3f(.6f,.6f,.6f));
                objMat.setLightingEnable(true);
                objApp.setMaterial(objMat);
                objApp.setColoringAttributes(col);
                col.setColor(.6f,.6f,.6f);
                shape.setAppearance(objApp);
                SetOriginalShape(shape);
            catch(FileNotFoundException e)
                System.err.println("Something went wrong while loading OBJ-File");
        }Sorry...

  • JSPM fails to start: Could not load data model com.sap.sdt.jspm.model

    Hi
    We running windows server with ERP 6.0 and this was coppied from another server.
    The JSPM fails with the following error.
    Trouble Ticket Report
    Java Support Package Manager for SAP NetWeaver'04s
    SID................: $(/J2EE/StandardSystem/SAPSystemName)
    Hostname...........: $(/J2EE/SAPGlobalHost)
    Install directory..: $(/J2EE/StandardSystem/SAPSIDDirectory)
    Database...........: $(/J2EE/DBSystem/DBInfoName)
    Operating System...: $(/J2EE/StandardSystem/CentralInstance/J2EEEngineInstanceHost/OpSysType)
    JDK version........: $(/SystemProperties/JavaVersion) $(/SystemProperties/JavaVendor)
    JSPM version.......: $(/MAIN_VERSION)
    System release.....: $(/J2EE/StandardSystem/Version)
    ABAP stack present.: $(/J2EE/StandardSystem/BCSystemPresent)
    The execution ended in error.
    Could not load data model com.sap.sdt.jspm.model.JspmDataModel. See previous messages.
    Class with name com.sap.sdt.j2ee.model.NWDISystemRole not found.
    More information can be found in the log file .
    Use the information provided to trouble-shoot the problem. There might be an OSS note providing a solution to this problem. Search for OSS notes with the following search terms:
    com.sap.sdt.tools.model.LoadException
    Could not load data model com.sap.sdt.jspm.model.JspmDataModel. See previous messages.
    JSPM_MAIN
    JSPMPhases
    NetWeaver Upgrade
    SAPJup
    Java Upgrade
    SAPJup.LOG
    <!LOGHEADER[START]/>
    <!HELP[Manual modification of the header may cause parsing problem!]/>
    <!LOGGINGVERSION[1.5.3.7185 - 630]/>
    <!NAME[D:
    usr
    sap
    ERP
    DVEBMGS10
    j2ee
    JSPM
    log
    log_2008_11_17_12_39_25
    SAPJup.LOG]/>
    <!PATTERN[SAPJup.LOG]/>
    <!FORMATTER[com.sap.tc.logging.ListFormatter]/>
    <!ENCODING[UTF8]/>
    <!LOGHEADER[END]/>
    #1.5 #C0000A0A0A3D00000000000F010E329300045BE031D40CA8#1226918373625#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.build.BuilderDirector.extractElements(BuilderDirector.java:132)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.build.BuilderDirector.extractElements(BuilderDirector.java:132)#Java###Tag with name found.#2#ControlUnit#JSPM#
    #1.5 #C0000A0A0A3D000000000010010E329300045BE031D577F0#1226918373718#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.build.BuilderDirector.createUnits(BuilderDirector.java:186)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.build.BuilderDirector.createUnits(BuilderDirector.java:186)#Java###Creating control unit .#1#JSPM#
    #1.5 #C0000A0A0A3D000000000011010E329300045BE031D6E720#1226918373812#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.ctrl.ExecutionDialog.showWelcomeDialog(ExecutionDialog.java:421)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.ctrl.ExecutionDialog.showWelcomeDialog(ExecutionDialog.java:421)#Java###Could not process dialog because execution dialogs have been suppressed.#1#JspmWelcomeDialog#
    #1.5 #C0000A0A0A3D000000000012010E329300045BE031D6E720#1226918373812#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#Java###Starting execution of action with name and type .#2#Unit#JSPM#
    #1.5 #C0000A0A0A3D000000000013010E329300045BE032541218#1226918382015#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#Java###Starting execution of action with name and type .#2#Modul#JSPMPhases#
    #1.5 #C0000A0A0A3D000000000014010E329300045BE032541218#1226918382015#/System/Server/Upgrade/Jump##com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#######Thread[main,5,main]##0#0#Info#1#com.sap.sdt.ucp.pce.ctrl.ActionExecutor.execute(ActionExecutor.java:103)#Java###Starting execution of action with name and type .#2#Phase#JSPM_MAIN#
    #1.5 #C0000A0A0A3D000000000015010E329300045BE0333D02E8#1226918397281#/System/Server/Upgrade/Jump##com.sap.sdt.tools.model.AbstractDataModelElement.getClassByName(AbstractDataModelElement.java:743)#######Thread[main,5,main]##0#0#Error#1#com.sap.sdt.tools.model.AbstractDataModelElement.getClassByName(AbstractDataModelElement.java:743)#Java###Class with name com.sap.sdt.j2ee.model.NWDISystemRole not found.##
    #1.5 #C0000A0A0A3D000000000016010E329300045BE0333D3D80#1226918397296#/System/Server/Upgrade/Jump##com.sap.sdt.tools.model.DataModel.load(DataModel.java:89)#######Thread[main,5,main]##0#0#Error#1#com.sap.sdt.tools.model.DataModel.load(DataModel.java:89)#Java###Could not load data model com.sap.sdt.jspm.model.JspmDataModel. See previous messages.##

    Hi Patrick ,
    What user did you use to start JSPM? Was it <sid>adm? Also based on the error it seems there is something wrong with DataModel.xml JSPM uses. And you've mentioned it was copied from another system if I get it right.
    So as a quick workaround you could try removing:
    - Jspm.DataModel.xml
    - Jspm.J2EE.DataModel.xml
    - Jspm.JSPM.DataModel.xml
    from ../j2ee/JSPM/data/variables directory and give JSPM another try.
    Please make sure the rest of the XMLs are in place otherwise JSPM won't start.
    Regards,
    Vasil

  • Trouble loading my printer

    im having trouble loading my epson printer to my mac, when i put the disc in a message pops up saying that powerPC is no longer supported? any help cheers!!

    System Preferences > Printing. Click the + button on the left side of the Printing prefs pane.
    This will call up the printer browser, where you can enter the location, IP address, etc.
    Lexmark drivers are included in the default installation of Mac OS X. I have no idea if they include a driver for your model, but it should be on Lexmark's site if not.

  • Having trouble loading pics to facebook from Curve 8330

    Is anyone else having trouble loading pictures to facebook from their Curve 8330? I have had my phone for approximately a year and a half and have had no issues loading pics to facebook up until I received the most recent notification that there was a newer version of facebook for blackberry. Ever since I loaded the newest version I have had nothing but problems trying to load pictures to facebook. I have attempted to load approximately 100 pictures and 3 or 4 have successfully loaded. The rest I get an error message indicating there was an error uploading the photo. I am getting very frustrated  as there seems to be no rhyme or reason to why it loads the photo's it does!? Just this morning I went out to my photo's on my blackberry and hit the "SEND TO FACEBOOK" option and that picture loaded, so immediately after that I tried to load two more and they failed? I have no trouble posting to facebook or replying to other posts or even commenting on photo's from my blackberry but for the life of me can't get photo's to load consistently! I have been loading pics with no issues since I've had the phone so I don't understand why now I am having nothing but issues!  HELP.........PLEASE...........AND THANKS! Carrier is verizon, not sure if it matters?

    You are not alone.
    I and others have experienced the same issue.
    Let me ask this:
    Device Model:
    OS release (Options > About, third line down):
    Facebook version (Options > Advanced > Applications):
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to increase BoundingSphere radius after loading .3ds model

    I can properly load in all .3ds models, however, after loading them into the canvas some .3ds models are far too large. When I zoom out (by pushing the model back with MouseZoom) the model disappears from view even though I have the boundingsphere declared as:
    BoundingSphere bounds = new BoundingSphere(new Point3d(), Double.POSITIVE_INFINITY);
    I add the loaded model (transformgroup.addChild(model.getSceneGroup());) and this contains the bounds as shown above.
    The weird thing is when I load .obj files using the same method it works fine. I can zoom out on these objects to infinity (until they are small dots).
    Why are the .3ds models disappearing from the bounds even when I have them set to POSITIVE INFINITY?
    Any ideas? Thanks.

    Try the Java 3D forum: [http://forums.sun.com/forum.jspa?forumID=21]

  • I'm having trouble loading photos on my I phone 4s and I pod.  I don't see the photos tab in Itunes?? Prob user error but wanted to get some help.

    I'm having trouble loading photos on my I phone 4s and I pod.  I don't see the photos tab in I-tunes? I'm sure its user error but wanted to get some help.

    What's the origin of this external drive? It sounds very much like it's a Windows-formatted (NTFS) drive which Macs can't write to. If you can, copy the files off the drive, reformat it as Mac format (using Disk Utility) and copy the files back. If you need to continue writing to it from a Windows PC, you should format it ExFAT in Disk Utility.
    Matt

  • Excel, PowerView error in SharePoint 2013: "An error occurred while loading the model for the item or data source 'EntityDataSource'. Verify that the connection information is correct and that you have permissions to access the data source."

    I've installed SQL Server 2012 SP1 + SP server 2012 + SSRS and PowerPivot add-in.
    I also configured excel services correctly. Everything works fine but the powerview doesn't work!
    While I open an excel workbook consist of a PowerView report an error occurs: "An error occurred while loading the model for the item or data source 'EntityDataSource'. Verify that the connection information is correct and that you have permissions
    to access the data source."
    error detail: 
    <detail><ErrorCode xmlns="http://www.microsoft.com/sql/reportingservices">rsCannotRetrieveModel</ErrorCode><HttpStatus xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message xmlns="http://www.microsoft.com/sql/reportingservices">An
    error occurred while loading the model for the item or data source 'EntityDataSource'. Verify that the connection information is correct and that you have permissions to access the data source.</Message><HelpLink xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0</HelpLink><ProductName
    xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName><ProductVersion xmlns="http://www.microsoft.com/sql/reportingservices">11.0.3128.0</ProductVersion><ProductLocaleId
    xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation
    xmlns="http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message msrs:ErrorCode="rsCannotRetrieveModel" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0"
    xmlns:msrs="http://www.microsoft.com/sql/reportingservices">An error occurred while loading the model for the item or data source 'EntityDataSource'. Verify that the connection information is correct and that you have permissions to access the
    data source.</Message><MoreInformation><Source>Microsoft.ReportingServices.ProcessingCore</Source><Message msrs:ErrorCode="rsErrorOpeningConnection" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsErrorOpeningConnection&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0"
    xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Cannot create a connection to data source 'EntityDataSource'.</Message><MoreInformation><Source></Source><Message>For more information about this error navigate
    to the report server on the local server machine, or enable remote errors</Message></MoreInformation></MoreInformation></MoreInformation><Warnings xmlns="http://www.microsoft.com/sql/reportingservices" /></detail>
    Please help me to solve this issue. I don't know if uploading the excel workbook is enough or maybe It needed to connect to another data source.
    I Appreciate in advance.

    Hi Ali.y,
    Based on the current error message, the error can be related to the
    Claims to Windows Token Service (C2WTS) and is an expected error under certain conditions. To verify the issue, please check the aspects below:
         1. The C2WTS Windows service and C2WTS SharePoint service are both running.
         2. Check the SQL Server Browser service is running on the machine that has the PowerPivot instance of SSAS.
         3. Check the domain. You're signing into SharePoint with a user account in some domain (call it Domain A).  When Domain A is equal to Domain B which SharePoint server itself is located (they're the same domain), or Domain
    A trusts Domain B.
    In addition, the error may be caused by Kerberos authentication issue due to missing SPN. In order to make the Kerberos authentication work, you need to configure the Analysis Services to run under a domain account, and register the SPNs for the Analysis
    Services server.
    To create the SPN for the Analysis Services server that is running under a domain account, run the following commands at a command prompt:
    • Setspn.exe -S MSOLAPSvc.3/Fully_Qualified_domainName OLAP_Service_Startup_Account
    Note: Fully_Qualified_domainName is a placeholder for the FQDN.
    • Setspn.exe -S MSOLAPSvc.3/serverHostName OLAP_Service_Startup_Account
    For more information, please see:
    How to configure SQL Reporting Services 2012 in SharePoint Server 2010 / 2013 for Kerberos authentication
    Regards,
    Heidi Duan
    Heidi Duan
    TechNet Community Support

Maybe you are looking for

  • Cancelled Invoice showing as Zeros in Unaccounted Transaction Report

    The invoices were entered and the error occured because there is no currency rate conversion for entered currency , then we cancelled the invoices .It is showing as 0.00 in Unaccounted Transactions Report and need swept every month." Please suggest h

  • Error while setWhereClauseParam in Controller with Date Parameter

    Hi All, I am strugling last couple days How to setWhereClauseParam in Controller with Date Parameter.. We have requirment 1, While search Page enter the Creation_date (Data Type is Date ) based on that feacthing ViewObject Query. 2, I created the Vie

  • Problems with SB Live 5.1 - Soundfo

    Hello, I got problems with my Soundblaster 5.. Since some weeks it doesn`t work. if i play any sound, i `didn`t hear it. When i use the Onboardsound, all works correctly! then i install the SB, deactivate onboard sound on the BIOS and install the new

  • Movie works on mac but not PC...help!

    Hi! Hopefully someone out there can help me... I am trying to make a video play on a website that I designed. The video will play on a mac, but not a PC. When the user clicks on the link, the video (.mov) should start playing in whatever media player

  • Java and daylight savings time

    I just tricked my OS into thinking it is DST but setting the date ahead a bit. After checking, my OS DOES think it is currently DST (with a date of April 3). However, Java doesn't seem to get it! For example, take the following two lines of code: