Sagewire Logo

3d java RSS Feed

Recent Posts View Recent Posts | View Archived Posts

Message from aaronhirshberg
Most recent post: 10/19/2007
2 authors and 3 replies.

My view disappears into the blackness when I translate more than a
certain number of meters away from it.
My bounds is 3000 meters, the thing is about 20 meters wide, 5 meters
high. I have four point lights.
Is it that the lights need to have more distance, the bounds, or
what? The view seems to disappear when I get about 20 or 30 meters
away from it.

Also, how do I control the brightness of directional light and ambient
light?

Aaron Hirshberg read more about Questions 10/15/07


Message from Miss Elaine Eos
Most recent post: 8/24/2007
4 authors and 4 replies.

I'm having trouble with a couple of bugs in my J3D app and have not been
able to find the answers here or elsewhere. Are there other, more
active, J3D communities?

Thanks!

--
Please take off your pants or I won't read your e-mail.
I won't, no matter how "good" the deal, patronise any business which sends
unsolicited commercial e-mail or that advertises in discussion newsgroups. read more about Other J3D communities?


Message from Misterysword
Most recent post: 8/1/2007
4 authors and 7 replies.

Hi!!

In my program, when I want to rotate or translate, movements abrupt.

How'd you smooth the movements of the mouse?

Regards! read more about To smooth the movements of the mouse


Message from Misterysword
Most recent post: 6/5/2007
2 authors and 2 replies.

Hi! I have got a program that it shows some scenes (I draw the scene,
I erase it, and I draw another scene...).

The problem is the flicker. I know that I must use the method of
double buffer.

How'd you do this method? (implementation)-->An example code,
please!!!

Regards!!! read more about flicker in scene3D


Message from Zerex71
Most recent post: 5/29/2007
2 authors and 3 replies.

Hello group,

This is my first posting to the group so please forgive me if this is
the wrong place to ask this question. I am developing a JAVA-based
simulator and at some point am going to want to incorporate 3D vehicle
models into my displays and am wondering what wireframes or 3D
geometry formats JAVA could accept to properly render the vehicle
models. I am assuming that you can not really "build" 3D models in JAVA
but that if you've an outside CAD program of some sort, you could
import it if you had it in the right format to feed to JAVA 3D - I am
asking about what formats are supported. Please enlighten me and send
me to any reference pages where this is discussed!

Thanks,
Mike read more about Basic questions about valid 3D models


Message from taejon
Most recent post: 5/23/2007
2 authors and 2 replies.

Hi

I am using JAVA1.4 and I develop on a mac 10.4 OS Tiger with Eclipse
3.1. I have an ascii-file with four column-values x y z rho. That
means coordinates x,y,z and the density. They are arranged in steps.
I want to import the file and to make the density in the x,y,z-space
visible in JAVA3D with canvas3d etc. Then I want to mark a part of the
density with the mouse and use the marked area for mathematical
operations (for example integration).
I have absolutely no idea how this can be performed, someone told me
something about voxels...

Is there any literature, source-code or anything availible ? Does
someone give me (in words) a principle idea how I have to tackle this
project ?

Thanks in advance

taejon read more about File import and mathematics


Message from Thomas Partsch
Most recent post: 5/16/2007
2 authors and 2 replies.

Hi!

Has anybody experience with JAVA3D and cyan/magenta glasses? I'd like to
make some applications with that kind of stereo-support. How can I use
JAVA3D to create such applications?

Regards
- Thomas read more about JAVA3D for 3D Glasses


Message from Misterysword
Most recent post: 4/24/2007
2 authors and 2 replies.

Hi!! I want to draw a points cloud. Then, I want to erase this points
cloud and to draw another cloud (to draw, to erase, to draw, to
erase...and so on) How'd you do this?

Would you make multiple scenes or only one?

Regards!! read more about to erase points cloud and to draw it.


Message from Misterysword
Most recent post: 4/24/2007
3 authors and 5 replies.

Hi all!! I have got a JAVA3D application that I show it in a JFrame.
So, everything is correct.

--->This schem is correct:

class program3D extends JFrame{

public program3D(){ }

public BranchGroup createSceneGraph(){ }

public static void main ( String arg[] )
{
new program3D();
}
}

_______________________________________________________________________
The problem is when I want to draw the scene inside of JPanel, and
then, this JPanel put inside of JFrame.

--->THE PROBLEM:The scene isn't seen !!!

class program3D extends JPanel{

public program3D(){ }

public BranchGroup createSceneGraph(){ }

public static void main ( String arg[] )
{
JFrame window=new JFrame("Main");
window.setLayout( new BorderLayout() );
window.getContentPane().add( new program3D(),
BorderLayout.CENTER); //PROBLEM

window.setSize(500,500);
window.setVisible(true);
}
}

Regards! read more about Scene inside of JFrame


Message from Misterysword
Most recent post: 4/12/2007
2 authors and 3 replies.

Hi!! I have got points like this (in a file): X=2,923, Y=-0,232,
Z=7,890.

In JAVA 3D, points must be between -1 and 1 (in a intervalo [-1,1]).
How do you change this points to intervale [-1,1] ????

Regards! read more about Points to intervale [-1,1]


Message from aaronhirshberg
Most recent post: 4/6/2007
2 authors and 2 replies.

The Deitel book with the JAVA 3D chapter has a good example of how to
use the mouse to implement translation and rotation. If I only want
to rotate around one axis, is there some way to take this Deitel mouse
rotation control and turn off the X and Z axes?

Aaron Hirshberg read more about I Only Want To Rotate Around One Axis


Message from llloyd wood
Most recent post: 4/2/2007
2 authors and 2 replies.

... I have bought and read LEARNING JAVA by niemeyer I loved it but find I need some hands on experience.
any help?

kevin

--
Sometimes I'm in a good mood.
Sometimes I'm in a bad mood.
When all my moods have cum to pass I hope they bury me upside down
so the world can kiss me porcelain,
white, Irish bottom.

--
Sometimes I'm in a good mood.
Sometimes I'm in a bad mood.
When all my moods have cum to pass I hope they bury me upside down
so the world can kiss me porcelain,
white, Irish bottom. read more about any help


Message from hunkgym
Most recent post: 3/15/2007
2 authors and 3 replies.

Good Day!

Would be appreciate to know any suggestion on the following coding
problem:

Originally, I've a JAVA application.

Now, I've developed a JAVA login form which is name as Login.JAVA

Would be appreciate to know how to compose the code to link to the
JAVA application after the user successful login.

Both JAVA source files (including the JAVA application) are stored at
http://tech.groups.yahoo.com/group/JAVAlogin/

Please refer the source file and suggest.

Thanks for any HELP! Danke! read more about Connect to JAVA application from JAVA login form


Message from vm.benjamin
Most recent post: 3/4/2007
2 authors and 2 replies.

Is there anyway to add more than one Shape3D object to a
TransformGroup and Position them.
I am building a molecule viewer and I need to add 3 spheres to one
TransformGroup so I can make use of the MouseRotation
class(com.sun.j3d.utils.behaviour.mouse.MouseRotation).
If not what are my other options? read more about Positioning and Transforming


Message from moleyharey
Most recent post: 2/19/2007
3 authors and 3 replies.

Hi folks!

I was looking at some Java API (application programming interface)to implement a JAVA 3D application
running as an Applet on the user's web browser.
I've seen JOGL (https://jogl.dev.JAVA.net/) and it seems to be a
good choice but I am not sure
if this is going to be too heavy for an Applet...

Has someone experience about 3D Applets?
Is JOGL currently the best choice?

Thanks in advance

Mh read more about JAVA 3D running on Applet


Message from den
Most recent post: 1/26/2007
4 authors and 7 replies.

Hi everyone (newbie here),

I'd like to develop my skills to become a professional JAVA developer.

I was wondering about your opinion regarding the JAVA 3d API. Is it
popular?
From my google searches it looks like JAVA3d is most popular in the
mobile


device realm. Everywhere else it appears quiet. So for instance I
wanted to
build a 3d applet for my website (to build my portfolio). Do you think
this is
wise? Or are there better alternatives?

Thanks for any advise,

Dennis. read more about Questions about using JAVA 3D


Message from Alexander Gran
Most recent post: 1/25/2007
2 authors and 2 replies.

Hi,

I looking for a possibility to track pointsin my 3D Enviroment.
My first idea was to do something like:
OrbitBehaviour.setRotationCenter(point);
This basically works, but the user has to click into the canvas (this seems
to redraw/relocate everything correctly). Any idea how to achive that
behaviour without an extra click?

regards
Alex
--
Some operating systems are called `user friendly',
Linux however is `expert friendly'.
Encrypted Mails welcome. Send spam to toZodiac@xxxxxxxxxxx, please.
PGP-Key at http://www.grans.eu/misc/pgpkey.asc | Key-ID: 0x6D7DD291 read more about how to follow a point


Message from Dimitri Ognibene
Most recent post: 1/16/2007
2 authors and 2 replies.

Where can I find some docs on physical engines and some benchmark
suite?
I was trying some by my self.. I must write a simulator for an
anthropomorphic learning robot...
but other then the API (application programming interface)I do not know how to compare speed and accuracy
is there any benchmark suite or a standard set of test?
Or is someone interested in building one?
let me know.
I will post this message in every forum I know related to physical
engines
C u
Dimitri Ognibene read more about Physics Engines comparisons and benchmarks


Message from sanbikinoraion
Most recent post: 1/13/2007
2 authors and 2 replies.

Hi,

Does anyone know of any way of easily converting floats or doubles into
hires coords? My plan is to use a locale for each planet in the solar
system, and write a custom rotationinterpolator that will rotate the
locales around the sun locale. My plan was to store and manipulate the
coordinates of the planets in an easier-to-use form than hires coords,
and then scale the doubles up to hi-res coords once the new planet
position has been calculated.

Any help in this matter'd be greatly appreciated.

Cheers,

-sanbikinoraion read more about Converting float/double to hires coords.


Message from marmu
Most recent post: 1/12/2007
2 authors and 4 replies.

Hello everyone,

I`m having great trouble by programming the following:

We are programming a miniature golf-game at university.
We want to enable the user to rotate, zoom and translate everything he
sees at once. We did this with an OrbitBehavior. As far as I know an
OrbitBehavior cannot be limited to angles and zoomfactor, is that
right? Because later we want to limit the zoom and the user shoudn`t be
able to look beneath the ground.

The other thing is an arrow, which we want to use for the drive. The
user should rotate it around one axis to set the direction. And the
size of the arrow should represent the power of the drive.
Problem here is the rotation around one axis.
This isn't want the PickRotateBehavior is for. Probably I've to
program my own behavior but how?
I`m using PickRotateBehavior and PickZoom. But Zoom doesn`t change the
size, it does what its name says, it zooms. So the arrow gets nearer to
the user...

If there are problems with using OrbitBehavior (for the whole scene)
together with PickRotate and PickZoom (for the arrow), please tell me.
I tried to replace the OrbitBehavior with PickRotate, PickTranslate and
PickZoom for the whole scene. And then I wanted to pick the arrow as
stated above.. But I can only pick the arrow and zoom it. Rotation of
the arrow doesn`t work and PickRotate, PickTranslate and PickZoom for
everything doesn`t work either.

Three Days passed and I`m stuck. Please give me some hints on how to
realize thi read more about multiple behaviors on multiple objects / move everything and if picked only one object


Message from tiago.cardoso
Most recent post: 1/7/2007
2 authors and 4 replies.

Hello,

I made a simple app with a simpleUniverse. After testing it and using
picking (worked fine).

I decided to implement the real app. The real app has to be in Ortho
projection and have tranformations on the viewbranch.

So, I implemented the a class extending virtualuniverse. I did
everything "by the book" I think and everything worked fine as for the
visual aspect, object showed up in the right place and the view was
right.

Now, I'm trying to use pickcanvas but it does not work at all :(
I have search a lot on the web and I already saw that there some kind of
problem with the pickcanvas pickshape for the customized
virtualuniverse.
In fact, the PickShape orign point, direction and start point do not
seem to make any sense at all.
(my objects have about 100 of size and the camera is ver faraway, and
the pickshape point is about (-0.07767107179733918,
-0.2967893129673346, 0.4174332443807395) although it changes - though I
do not understand how and why)

My universe has only a Locale. A world branch where I've my objects
and a view branch with my viewplataform and where I apply my
tranformgroup to change the camera point of view.
I use...

projection2.ortho(0, _width, 0, _height, -BACK_CLIP_DISTANCE,
BACK_CLIP_DISTANCE);

Transform3D cameratransf= new Transform3D();
this.getTransformGroup().getTransform(cameratransf);
projection2.mul(cameratransf);
view.setLeftProjection(projection2);

... to have a ortho projection.

Any tips read more about Trouble Picking with my own VirtualUniverse on Ortho Projection


Message from Thomas Partsch
Most recent post: 12/20/2006
3 authors and 6 replies.

Hi there!

In Daniel Selmans book "JAVA 3D Programming" (ISBN 1930110359) there is
an example given for scheduling bounds for a behavior (page 165):

There is a behavior that rotates a wheel only if the car is within 20
meters of the viewer. That is, if the Bounds for the Behavior intersect
the ViewPlatform's activation region.

My question is now: What are the parameters for the Bounds? Radius is 20
meters, of course, but where is the origin of that BoundingSphere
(considering it'd be a BoundingSphere)?

Regards,
Thomas read more about Scheduling Bounds of a Behavior


Message from hoa123
Most recent post: 11/28/2006
3 authors and 3 replies.

I am using PickCanvas class in my application and it is correct to pick a
shape on MOUSE_PRESSED or MOUSE_CLICKED event in MyBehaviour object. Though I
could receive MOUSE_ENTERED or MOUSE_EXITED in MyBehaviour object, the
PickCanvas couldn't pick a shape (it always returns a null PickResult object
in this case).

My scene graph tree:
BG
|-> TG -> S
|-> TG -> S
|-> Behaviour

I am very appreciate if you could give me some advices. Thanks in advance. read more about Pick a Shape on MOUSE_ENTERED event


Message from gno
Most recent post: 11/21/2006
3 authors and 3 replies.

I've made a graphics JAVA applet that shows a moving fractal. I made
it in a computer with a 1GHz processor. In this processor the applet
runs smoothly without any blinking.

The problem is that in new machines with faster processors the moving
object blinks in a slightly annoying way.

How could I make it not blink at any processor speed?

(I intend also to preserve the motion speed of the object to be always
the same on any processor.)

You can find the applet (source included) at:

http://josechu.com/moving_fractal/I'm not sure, but perhaps the key to fix this problem is at this
portion of code:

public void run() {
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
while (true) {
try {
Thread.sleep(44);
} catch (InterruptedException ex) {
}
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
repaint();
}
}

Any suggestion will be welcome. read more about Graphics applet blinks on fast processors


Message from Bruce Feist
Most recent post: 11/9/2006
2 authors and 4 replies.

I have recently started playing with JAVA3d; I teach JAVA in HS and am
eventually hoping to incorporate some game design into my course.
Anyway, I'm running into a bit of a problem which I have not been able to
solve using the Sun tutorial or the API (application programming interface)documentation.

I'm displaying a shape called a Mobius strip, and I want to display it
in such a way that you can tell which side you're looking at
(technically it has just one side, but the concept remains). If you
do not know what a Mobius strip is, that probably won't matter for your
answer to the problem -- if you're curious, think of it as a long strip
of paper in a loop, with a twist in it so that what was the 'front'
turns into the 'back'.

One possibility'd be to display a series of parallel arrows pointing
across the strip, something like this:

----------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----------------------------

The arrows'd point up on one side, and down on the other. Another
possibility'd be to use two colors to draw it, one for the top and
the other for the bottom. I do not much care which; they all boil down
to the same problem, which I can not figure out how to solve: how do I get
the two sides to look different? Can I've two textures, one which is
visible from the front and the other from the back? Must I resort to
havng two actual surfaces at a small displacement from each other?
(This one'd actually be pretty read more about Newbie Question: How do I get a surface to look different on itssides?


Message from Richard
Most recent post: 11/5/2006
2 authors and 5 replies.

Given a cube I'd like to spin it in space by rotating it about its
y-axis once every 4 seconds, about its x-axis once every 3 seconds and
about its z-axis once every 5 seconds.

Do not know how to proceed from following code which rotates it about
y-axis

objTrans.addChild(new ColorCube(0.4));

Transform3D yAxis = new Transform3D();
Alpha yAlpha = new Alpha(-1, 4000);

RotationInterpolator yRotator =
new RotationInterpolator(yAlpha, objTrans, yAxis,
0.0f, (float) Math.PI*2.0f);

BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);

yRotator.setSchedulingBounds(bounds);

objRoot.addChild(yRotator); read more about Using RotationInterpolator to rotate about multiple axis?


Message from Thomas Partsch
Most recent post: 10/22/2006
3 authors and 8 replies.

Hi!

In my current project I am using the VirtualUniverse class instead of
the SimpleUniverse, because I need two views that are displayed
simultaneously (for a stereoscopic view). So the views are working fine,
but I obviously got a problem with PickBehaviors.

With SimpleUniverse the PickBehaviors are working fine (picking and
rotating, translating and scaling of two boxes). But in my
VirtualUniverse the PickBehaviors do not work fine at all: You've to
pick the box somewhere else in the Canvas, e.g. if the box is in the
middle of the screen, you've to pick it on the left side of it. This
is quite strange to me.

So my question is: What is so special about the SimpleUniverse that the
Behaviors work there just fine and in the VirtualUniverse they do not?

Greetings
Thomas read more about SimpleUniverse VS VirtualUniverse


Message from Brian Bagnall
Most recent post: 9/25/2006
2 authors and 2 replies.

I'm looking to create a simple JAVA app that outputs a bunch of 3D points
(X, Y, Z) into a window. Possibly being able to rotate the image of the dots
to appreciate the 3D. What'd be my best way to do this in JAVA? The JAVA
3D API (application programming interface)seems like overkill since you *need* OpenGL and a 3D card, but I'm
sure my app'd run fine on any system without 3D hardware.

- Brian read more about 3D Points


Message from flymagnetic
Most recent post: 9/8/2006
2 authors and 3 replies.

Can anyone please explain what is going on here? I am trying to
manipulate a ViewPlatform. The sample code below hopefully should
illustrate what is going wrong. I first set up the position of the
platform, with the user placed at (9, 0, 0) on the X-axis, with the
user looking down the X-axis, away from the origin. When I print its
position it prints (9, 0, 0). Sometime later, I choose to rotate the
transform.

However after the call to tg.rotY() the position is reset to (0, 0, 0).

Why?

And can I extract the position so I can save it along with the
rotation? Sample code is included below.

//----------------------------------------------------------------------
// Set the viewing direction.
//----------------------------------------------------------------------
Transform3D t3d = new Transform3D();
tg.getTransform(t3d);
Point3d USERPOSN= new Point3d(9, 0, 0);
Point3d CENTRE = new Point3d(20, 0, 0);
Vector3d UP = new Vector3d(0, 1, 0);
t3d.lookAt(USERPOSN, CENTRE, UP);
t3d.invert();
tg.setTransform(t3d);
//----------------------------------------------------------------------
// Print the view platform's current position.
// This prints (9, 0, 0).
//----------------------------------------------------------------------
printViewPlatformPosition(vp);

// ...

//----------------------------------------------------------------------
// Some time later rotate the transform group and then print the
// position. This prints ( read more about Help with Transform3D.rotY()


Message from researchtwo
Most recent post: 8/16/2006
4 authors and 4 replies.

My name is Lorenzo Crescini and I'm Italian. These "Flashes on
Good and evil" reflect the same mood characterizing the Flashes on
wrote in message in Africa: making
myself useful to our Lord Jesus Christ.
I'll start by quoting the best Prayer to Jesus I have ever read.
At the very beginning some reflections concern the devil one.
I thank all those who will read me, write to me, will ask for an
explanation and those who will be able and willing to advertise what
they read by Web, the press or however they like.
I am confident that the last of my Reflections containing a few lined
short account of my life, will be devoted to all of us who are proud
of the Lord.

Web site
www.lorenzocrescini.it/reflections
personal e-mail for communications
ricercapap@xxxxxxxxxxx

Best regards

Here are three Reflections as an example

24) One cannot or mustn't say to those who are ill and suffering: "
That's God who puts you to the test". In this way we'd offend
The God of Endless Love who cannot wish our suffering. One needs say to
those who suffer: " God's Son himself suffered because of evil, but
you'll also resurrect with Him, as He did". That is the truth and
only the truth can give one who suffers the Hope which won't let him
fall into that despair the devil one wants to seize his soul and
conscience! Saying: "it's God who puts you to the test" gives a
suffering man the same relief a learned lecture on food chemistry gives
a starving one.

29) W read more about Reflections on good and evil


Message from Starter3D
Most recent post: 8/5/2006
2 authors and 2 replies.

Hi All,

I am an experienced JAVA developer and since a few weeks I joined a project
which involved real time rendering of 3D objects and interaction with those
objects. I've a problem for which I hope that an experienced 3D programmer
can help me.

Usage:
* I’ve rendered an 3D Sphere object which in this case is a perfect ball (not
eggs shape) using Spherical Texture mapping.
* The idea is that a user can interact with this ball and rotate the ball.
The user clicks a location on the ball and the user is to enter a ‘dot’ on
the ball. Thereafter the user can rotate the ball and place other dots on the
ball.

Problem statement
* When a user clicks the surface of the ball our application is able to get
the mouse position (x, y) in Canvas2D.

Question: How can I convert the mouse position to the Texture position in
order to update the ball surface?

If you are able to help or if you need more information please let me know
because I am really stuck with this.

Martijn Hermanns read more about Convert mouse position to Texture position on ball


Message from Carste Marx
Most recent post: 8/2/2006
3 authors and 4 replies.

Hello,
for an expert in JAVA3D this might be an easy question. For me, novice,
it's driving me nuts...

Problem:

I've a StartPoint (sx,sy,sz) and a EndPoint (ex,ey,ez).
- I have created a Clylinder with some standard radius and the distance
between the two points as lenght.
- I have translated the Cylinder with Transform3D.setTranslation to the
right position.
- Now I want to rotate the Cylinder around the X,Y,Z axis to 'connect'
the two points withe the Cylinder.
For this rotation I need the angles to rotate and the way how (and in
which order) I must apply the rotations and translations....

Anybody out there whi has done this? Isn't well documentated...

Please help me!!!Thanks and best regards....

Carsten read more about rotX,totY,rotZ to transform a Cylinder


Message from aaronhirshberg
Most recent post: 7/13/2006
2 authors and 2 replies.

I've been through the Dietel chapter on JAVA 3D, and been to some
on-line courses on JAVA-3D, and have done some interesting stuff with
it, but I want to know the following:

Can I make an applet with the current version of the JAVA Plug In for
IE, or is that never going to happen? If this is the #1 question in
the Intergalactic FAQ, I apologize in advance.

Aaron Hirshberg read more about Newbie Question


Message from priya_das7
Most recent post: 6/4/2006
2 authors and 2 replies.

Hi Friends,

Do not missout on these articles on design techniques:

The Factory Design Pattern:
http://JAVAlive.com/modules/articles/article.php?id=18

Effective use of Interfaces and Abstract Classes:
http://JAVAlive.com/modules/articles/article.php?id=17

Why ORM Tools aren't Recommended:
http://JAVAlive.com/modules/articles/article.php?id=16

Interfaces and Abstract Classes - the pillars of software design:
http://JAVAlive.com/modules/articles/article.php?id=15

How to Estimate Project Deadlines:
http://JAVAlive.com/modules/articles/article.php?id=14

Regards,
Priya read more about The Factory Design Pattern


Message from Dave
Most recent post: 5/17/2006
3 authors and 3 replies.

I've a method that generates a Shape3D. I want to regenerate that shape
and replace the Shape3D originally added to the scene graph with the newly
generated one. How do I do this?

tg = new TransformGroup();
tg.addChild(generateShape());
rootBranchGroup.addChild(tg);

I want to replace the Shape3D added to tg with a new one created by
generateShape(). read more about Replace Shape3D in scene graph


Message from Japs
Most recent post: 5/13/2006
3 authors and 5 replies.

Hi all!
I'm new to this NG so I will try to explain my problem.
I'm using JAVA3D into a JApplet. This is the code

[CODE]
import JAVA.util.*;
import JAVA.net.*;

import JAVA.awt.*;

import JAVAx.swing.*;

import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;

import JAVAx.media.j3d.*;
import JAVAx.vecmath.*;

...

public class OSESKeyNav extends JApplet
{
private static final int WINDOW_WIDTH = 800;
private static final int WINDOW_HEIGHT = 700;

private static URL url = null;

private int simulationStage = 0; // 0->init, 1->prima visualizzazione

private Receiver receiver;
private Sender sender;
private ObjectsUpdater updater;

private HashMap objList;

private UniverseManager universe;

private Camera camera;

public OSESKeyNav() { }

public OSESKeyNav( String host )
{
receiver = new Receiver( host );

objList = new HashMap();

setLayout(new BorderLayout());

GraphicsConfiguration config =
SimpleUniverse.getPreferredConfiguration();

Canvas3D canvas3D = new Canvas3D( config );
canvas3D.setSize( WINDOW_WIDTH, WINDOW_HEIGHT );
add("North", canvas3D);

universe = new UniverseManager();

createSceneGraph(); read more about Problem with MainFrame class in JApplet


Message from pyper33594
Most recent post: 5/11/2006
3 authors and 4 replies.

I've created a 3d cube that spins. My problem is that it spins
extremely fast! Can I add anything or do anything to make this slow
down??? PLease help
THanks<APPLET CODE="image3dcube.class" WIDTH=350 HEIGHT=400>
<PARAM name="speedvalue"="1">
<PARAM name="POVvalue"="2">
<PARAM name="Thetavalue"=".01">
<PARAM name="background" value="FFFFFF">
<PARAM name="shadowcolor" value="FFFFFF">
<PARAM name="textcolor" value="000000">
<PARAM name="spotlight" value="no">
<PARAM name="showlightbutton" value="no">
<PARAM name="sleeptime" value="8">
<PARAM name="target" value="_self">
<PARAM name="anglestep" value="3">
<PARAM name="mouseresponse" value="5">
<PARAM name="zoomspeed" value="1">
<PARAM name="image0" value="image1a.jpg">
<PARAM name="image1" value="image2a.jpg">
<PARAM name="image2" value="image3a.jpg">
<PARAM name="image3" value="image4a.jpg">
<PARAM name="image4" value="image5a.jpg">
<PARAM name="image5" value="image6a.jpg">
<PARAM name="url0" value="http://www.geocities.com/pyper33594/cube">
<PARAM name="url1" value="http://www.geocities.com/pyper33594/cube">
<PARAM name="url2" value="http://www.geocities.com/pyper33594/cube">
<PARAM name="url3" value="h read more about I am REALLY new to this-need to slow down 3d cube


Message from matthiasvangorp
Most recent post: 5/2/2006
2 authors and 6 replies.

Hi,

I'm trying to add a Shape 3d to an object, but I get a
nullpointerexception.
I have a class displaypoints and a class simplebehavior. When
simplebehavior is called upon I'd like to see the new shape appear.the code for displaypoints is like this

public class DisplayPoints extends Applet {

private SimpleUniverse u;
private Canvas3D c;
private BranchGroup objRoot;

public BranchGroup createSceneGraph() {

objRoot = new BranchGroup(); Transform3D rotate = new Transform3D();
Transform3D tempRotate = new Transform3D();
rotate.rotX(Math.PI / 7.0d);
tempRotate.rotY(Math.PI / 4.0d);
rotate.mul(tempRotate);
TransformGroup objRotate = new TransformGroup(rotate);

objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
objRoot.setCapability(BranchGroup.ALLOW_DETACH);

//add behavior
SimpleBehavior myRotationBehavior = new
SimpleBehavior(objRotate);
myRotationBehavior.setSchedulingBounds(new BoundingSphere());
objRoot.addChild(myRotationBehavior);
//end of adding behavior

objRoot.addChild(objRotate);

//then I add some shape3D's to the transformgroup
// like this : objRotate.addChild(Shape3D);

objRoot.compile();
return objRoot;
}

pub read more about add shape3D to scene


Message from Dekard
Most recent post: 5/1/2006
2 authors and 2 replies.

As with most newbie's, I am having problems with lighting effects. To
be more precise I only wish to differentiate between each side of a box
so that the surfaces don't blend. As I am repeating the same box in
different dimensions many times in different locations, I thought I
might attempt to create a different colour for each surface of the box,
therefore faking a lighting effect. However, I can not find any example
of this, can any body provide me with a link to an exmaple of such a
shape? read more about Shapes with unique surfaces


Message from tony_lincoln
Most recent post: 4/24/2006
2 authors and 2 replies.

Dear friends,

I am making a program which uses several windows at the same time. The
problem is, When I close one window, the whole program will exit. How
to close just one window without exitting the whole program?

Many thanks.
tony read more about How to close one window without exitting the program?


Message from aleksandar
Most recent post: 4/21/2006
2 authors and 4 replies.

hi all,
I need help (as everyone else) :))

I'm trying to do the following.
whan i'm over some object and I press mouse button, after which i'm
doing the drag, I want that when mouse is moved the object also moves
but in such manner that the gripped point(on object)i s laways under
mouse pointer.

thanks read more about How to grip and move the object with mouse


Message from Dave
Most recent post: 4/15/2006
2 authors and 3 replies.

I am trying to add lighting to a simple 4x4 QuadArray terrain mesh.

However all that seems to happen is that the color I've specified for the
Shape3D object is displayed purely i.e. no shading at all just 100% the same
color all over the object. The only effect the light seems to be having is
direction i.e. you can only see the shape at all when one surface is
pointing down the way.

I've tried both AmbientLight and DirectionalLight and they are both having
no effect. My addLight method and Terrain class constructor is below.

public void addLight(Color3f color)
{
// Creates a bounding sphere for the lights
BoundingSphere bounds = new BoundingSphere();
bounds.setRadius(1000d);
AmbientLight lightA = new AmbientLight(true, color);
lightA.setInfluencingBounds(bounds);
// Then add it to the root BranchGroup
rootBranchGroup.addChild(lightA);
}

public Terrain(float[ ][ ] hf, Appearance app)
{
heightField = hf;
appearance = app;
geometryInfo = new GeometryInfo(GeometryInfo.QUAD_ARRAY);

Point3f[ ] coordinates = new Point3f[64];

//... "coordinates" generated here ...

geometryInfo.setCoordinates(coordinates);
NormalGenerator normalGenerator = new NormalGenerator();
normalGenerator.generateNormals(geometryInfo);
geometryArray = geometryInfo.getGeometryArray();
} read more about Lighting having no effect


Message from Dave
Most recent post: 4/13/2006
2 authors and 3 replies.

I want to create a 3d map so that you can see roads and elevation (i.e.
terrain... so you can see hills). What objects should I use in the JAVA3d
hierarchy to achieve this?

My terrain will obviously consist of a bunch of triangles. How do I
implement such a triangle using JAVA3d?

Any advice'd be appreciated. read more about 3D Terrain


Message from neiderer
Most recent post: 4/6/2006
2 authors and 2 replies.

I haven't done any JAVA3D for 4/3 years now but I am starting to get back to it.
Since then our sys administrators have placed JDK 1.6 (used to be 1.4.2) on our
Linux RH Enterprise 2.4 and I think JAVA3D 1.4. I can translate HelloUniverse.JAVA
just fine, but when I go to execute it I get the following

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

$JAVA HelloUniverse

JAVA 3D WARNING : reported GLX version = 1.2

GLX version 1.3 or higher is required

The reported version number may be incorrect. There is a known

ATI driver bug in glXQueryVersion that incorrectly reports the GLX

version as 1.2 when it really is 1.3, so JAVA 3D will attempt to

run anyway.

************************************************************************

*** ERROR: Canvas3D constructed with a null GraphicsConfiguration

*** This will cause a NullPointerException in a subsequent release

************************************************************************

Exception in thread "Thread-1" JAVA.lang.NullPointerException: Canvas3D: null

aphicsConfiguration

at JAVAx.media.j3d.Canvas3D.<init>(Canvas3D.JAVA:1182)

at JAVAx.media.j3d.Canvas3D.<init>(Canvas3D.JAVA:1147)

at HelloUniverse.init(HelloUniverse.JAVA:102)

at com.sun.j3d.utils.applet.MainFrame.run(MainFrame.JAVA:267)