Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / October 2003

Tip: Looking for answers? Try searching our database.

Texture on a sphere

Thread view: 
André Kpetz - 04 Oct 2003 19:25 GMT
Hello NG,

I try to get a Texture on rotating sphere.
When I start my application I just get an unicolored
sphere that is rotating. In the case the link to the
texture is wrong the color of the sphere is white.
With the right texture-link the sphere is blue.
I have try to compare with the Java3d/Demos but I do
not know whats wrong :-(

Now the Sourcecode is following:

 public BranchGroup createSceneGraph() {

    BranchGroup ContentBranch = new BranchGroup();
    TransformGroup TG = new TransformGroup();
    TG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    ContentBranch.addChild(TG);
    Appearance World = new Appearance();
    Appearance app = new Appearance();
    try{
        texImage = new ava.net.URL("file:../ownpics/world.jpg");
    } catch (java.net.MalformedURLException ex) {
           System.out.println(ex.getMessage());
        System.exit(1);
    }
    TextureLoader mytex = new TextureLoader(texImage, this);
    World.setTexture(mytex.getTexture());
    TextureAttributes texAttr = new TextureAttributes();
    texAttr.setTextureMode(TextureAttributes.MODULATE);
    World.setTextureAttributes(texAttr);   
    TG.addChild(new Sphere(0.5f,World));
   
    [...] // here follows the behavior for the roation

        ContentBranch.compile();
    return ContentBranch;
    }

Regards André
P. Flavin - 06 Oct 2003 14:05 GMT
Map an image on a Sphere, create the Earth, like this:


http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/ConicWorld/
TexturedSphere.html


   public TexturedSphere(java.net.URL url) {
    texImage = url;
  }


http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/ConicWorld/
TexturedSphere.java


 Model the Solar System and drive a Rover on Mars with VRML & Java:
 -----------------------------------------------------------------
 |
 http://www.frontiernet.net/~imaging/Nasa_3d_animation.html

> Hello NG,
>
[quoted text clipped - 36 lines]
>
> Regards André


http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/TextureTest
/MultiTextureTest.html


  if (texImage == null) {
         // the path to the image for an applet
         try {
           texImage = new java.net.URL(getCodeBase().toString() +
                       "../images/stone.jpg");
       }
       catch (java.net.MalformedURLException ex) {
           System.out.println(ex.getMessage());
        System.exit(1);
       }
    }


http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/TextureTest
/TextureImage.java

 http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/

Java3d Demos Hosted by US Navy Post Graduate School
  ---------------------------------------------------

   AWT_Interaction /
   AlternateAppearance /
   Appearance /
   AppearanceMixed /
   Background /
   Billboard /
   ConicWorld /
   FourByFour /
   GearTest /
   GeometryByReference /
   GeometryCompression /
   HelloUniverse /
   LOD /
   Lightwave /
   ModelClip /
   Morphing /
   ObjLoad /
   OffScreenCanvas3D /
   OrientedShape3D /
   PackageInfo /
   PickTest /
   PickText3D /
   PlatformGeometry /
   PureImmediate /
   ReadRaster /
   Sound /
   SphereMotion /
   SplineAnim /
   Text2D /
   Text3D /
   TextureByReference /
   TextureTest /
   TickTockCollision /
   TickTockPicking /
   VirtualInputDevice /
   geometry /
   images /
  |
  http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/
 |
http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/geometry/be
ethoven.obj

  |
  |
Animation of NIST & US Navy PGS models with Java3d
 -------------------------------------------------

http://www.JavaGaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=;action=display;num
60641747

 |
  Java3d can Load & Animate VRML & other datafiles in your browser
  ----------------------------------------------------------------
   without the certificates or other additional downloads required
   by the buggy "new" Yumetech.com loaders as demonstrated by the
   above programs from Nasa and the Navy US Postgraduate Shcool. ...
 |
  cc: Sharon Laskowski ( laskowski@nist.gov ):
  |
  Sharon Laskowski, please Reply or Resign or do both.
  |

http://www.itl.nist.gov/iad/vvrg/staff/sharon.html#CriminalFraudWithYumetech

  |
  Sharon, Your responces in our conversation about the
  ------  criminal conduct in your area of responsibility is
   ___ unacceptatble ___ and your criminal cronies continue
  to lie and betray the missions and mandates of NIST & NSF.
  |
  http://www.xasa.com/grupos/comp/article.php?id7213&group=comp.lang.vrml

 Get portable, reliable 3d animation in a browser with Java3d
using the Sun VRML Loaders, don't encourage the Yumetech fraudsters
and the criminal fraudsters at the NIST commit crimes with them.

 Animate NIST, US Navy PGS, NSF Fingerspelling with VRML, portably.
 -------------------------------------------------------------
 http://www.frontiernet.net/~imaging/vrml_loaders_working.html

 -- Paul, Java Developer & Web Animator
 --------------------------------------
 Imaging the Imagined: Modeling with Math & a Keyboard


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.