AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Texture on a sphere

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
André Kpetz
Guest





PostPosted: Sat Oct 04, 2003 6:25 pm    Post subject: Texture on a sphere Reply with quote



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é

Back to top
P. Flavin
Guest





PostPosted: Mon Oct 06, 2003 1:05 pm    Post subject: Re: Texture on a sphere : Create the Earth, Model the Solar Reply with quote




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:
-----------------------------------------------------------------
Quote:

http://www.frontiernet.net/~imaging/Nasa_3d_animation.html



André Kpetz wrote:
Quote:
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é



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 /
Quote:

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/beethoven.obj


Animation of NIST & US Navy PGS models with Java3d

-------------------------------------------------

http://www.JavaGaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=3D;action=display;num=1060641747
Quote:

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. ...
Quote:

cc: Sharon Laskowski ( [email]laskowski (AT) nist (DOT) gov[/email] ):

Sharon Laskowski, please Reply or Resign or do both.


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

Quote:

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.
Quote:

http://www.xasa.com/grupos/comp/article.php?id=37213&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


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.