开发者

"Refers to the missing type Point3d" in J3D API (Java)

Apparently the J3D API is NOT included in my ver开发者_JAVA技巧sion of JDK. I have downloaded the source code for it from Java 3D Downloads: Release Builds — Java.net

I copied both the "vectormath" and "j3d" folders into my "org" folder and changed all the package javax.media.j3d to package org.j3d...

My version (Helios) of Eclipse IDE is giving me the error:

The method transform(Point3d, Point4d) from the type Transform3D refers to the missing type Point3d

at transform(direction, xformDirection);!

The same problem is popping up at A LOT of different places, except with different methods.


Point3d should refer to javax.vecmath.Point3d. That particular class can be found in vecmath-1.3.1.jar. Do you have that jar included in your project? One possible place to get that if you need it is http://mirrors.ibiblio.org/pub/mirrors/maven/java3d/jars/vecmath-1.3.1.jar.

EDIT

Ok, I went and did a little playing around and here. Try these steps:

  1. Visit the site you recommended
  2. Choose the correct installer for your system architecture
  3. Run the installer
  4. Open your Eclipse project
  5. Add external jars under the Java Build Path properties. Go to the directory where Java3D was installed. Choose all 3 jar files.
  6. Your code should be fine now. Here is a code sample (which does nothing but proves I get no errors anyway) which works for me. Point3d is correctly recognized.

    package main;
    
    import javax.media.j3d.Transform3D;
    import javax.vecmath.Point3d;
    
    public class Sneeze {        
        public void test() {
            Point3d p3 = new Point3d(7, 4, 2);
            Transform3D t = new Transform3D();
            t.transform(p3);
        }
    }
    

The only problem I see is if you do not have privileges to install Java3D or otherwise choose not to install it. But if you do not want to install, try the binary download and follow a similar procedure. Hope we got it this time :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜