Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 4
1  Java Game APIs & Engines / Java 3D / Re: GeometryInfo getCoordinates() vs. setCoordinates() ? on: 2010-11-21 14:32:31

Hi, Riven:

Thanks for your reply!! Java3D is dead. What is alive?
I was told that JOGL is dead as well.
The only thing alive is JME ?

Any other suggestions? Many thanks.

Best Regards
JIA


I'm not trying to sound harsh, but you've been told time and time again that Java3D is dead technology. Nobody uses it, nobody supports it, nobody patches it. If you still decide to use Java3D, you're pretty much on your own.

Sorry.
2  Java Game APIs & Engines / Java 3D / GeometryInfo getCoordinates() vs. setCoordinates() ? on: 2010-11-21 13:39:04

Hi, all:

Sorry for my stupid question but I've got to ask all of you a question...
I debugged into ObjectFile.class and try to understand how to use setCoordinates() and getCoordinates()...

After loading a 3D object from the file "a.obj", the debug information at the following line in file ObjectFile.class tells that
coordArray is of length 75,972
1  
gi.setCoordinates(coordArray);


However, after "a.obj" has been loaded into a Scene "s" and I just use the following lines of code
1  
2  
3  
4  
5  
BranchGroup bg = s.getSceneGroup();
Shape3D obj3d = (Shape3D)bg.getChild(0);
GeometryArray ga = (GeometryArray)obj3d.getGeometry();
GeometryInfo gi = new GeometryInfo( ga );
Point3f[] myCoordArray = gi.getCoordinates();

The length of myCoordArray is 183,947 .

It's strange that getCoordinates() and setCoordinates() of GeometryInfo are not a pair ?? Am I right?
Furthermore, how to update the coordinates  (in .obj file, the "v" lines) in a Shape3D ?
I mean, if I loaded a .obj file, setCoordinates() will load 75,972 "v"s.
But, I would like to update these loaded coordinates with another 75,972 coordinates.
I thought I could make it just by another setCoordinates() of GeometryInfo, however, the loaded object displays wrongly.
Then, I tested why it's wrong by getCoordinates().
I found, although the original setCoordinates() only affords 75,972 coordinates,
after loading the object, getCoordinates() informs 183,947 coordinates.

Where am I wrong? And How to update those coordinates?

Thanks very much.

Best Regards
JIA





3  Java Game APIs & Engines / Java 3D / Reset GeometryInfo in Shape3D without saving and reloading .obj ... on: 2010-11-20 15:50:32

Hi, all:

This could be a silly question but I really need a help.... Urgent help please...

1) First, I'm able to load .obj file successfully. For instance, the current loaded .obj file "a.obj" looks like:
Quote
v ...  ...  ...
v ...  ...  ...
............
vt ...  ...  ...
vt ...  ...  ...
............
f ...  ...  ...
f ...  ...  ...
............
In order to display "a.obj" on the screen, I have to load this "a.obj" by using
1  
2  
3  
4  
5  
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY | ObjectFile.RESIZE; 
ObjectFile f = new ObjectFile(flags, (float)(creaseAngle * Math.PI / 180.0));
Scene s = f.load("a.obj");  // Exception is ignored here by me
BranchGroup bg = s.getSceneGroup();
Shape3D obj3d = (Shape3D)bg.getChild(0);


Whenever I updated the values of "v" (let's just call it "updated-v"), I saved the data into another .obj file "b.obj".
(Note, values of "vt" and "f" are unchanged. )
In order to display it on the screen, I have to reload this "b.obj" by using
1  
2  
3  
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY | ObjectFile.RESIZE; 
ObjectFile f = new ObjectFile(flags, (float)(creaseAngle * Math.PI / 180.0));
Scene s = f.load("b.obj");

again, which I think is a very silly way.
Because to save the data onto the hard-drive and reload the data from the hard-drive into the memory is very very time-consuming.

2) I'm guessing that I should be able to assign the "updated-v" values directly into the already-loaded Shape3D "obj3d".
Therefore, I tried the following:
1  
2  
3  
4  
GeometryArray ga = (GeometryArray)obj3d.getGeometry();
GeometryInfo gi = new GeometryInfo( ga );
gi.setCoordinates("updated-v");
obj3d.setGeometry(gi.getGeometryArray());

However, there is something displayed, but the scaling is wrong, and the shape and texture is not what I expected.

I re-iterate it once again.
a) If I save "updated-v" into the "b.obj" directly and reload "b.obj", I can display the object correctly, with correct Shape3D, but this is too time-consuming.
b) If I just use the above 4 lines of codes as shown in 2), the object is displayed wrongly, wrong Shape3D for sure, and wrong scaling. Wrong displaying texture is probably due to the wrong Shape3D.

Can anybody please give me a hand on my difficulty?

Best Regards
JIA








4  Java Game APIs & Engines / Java 3D / Re: sawtooth when loading a self-made data using Java3D... on: 2010-06-17 11:08:29

What are active engines?
As far as I know, JOGL is dead as well.
Now, it seems JCGL is the next replacement.
And, JME is based on JOGL.
oops..
Can you please show me the correct direction?

Best Regards
JIA

Looks like a mipmap... but even then, as said in other threads of yours: nobody is using Java3D anymore, why not use another (actively supported) engine?
5  Java Game APIs & Engines / Java 3D / sawtooth when loading a self-made data using Java3D... on: 2010-05-25 08:08:48


Hi, all:

I'm trying to load a 3D data "input_sample_sphere_radiation.dat" as attached.
However, when loading, by using Java3D, I always obtain those sawtooths, please refer to file "input_sample_sphere_radiation.jpg"
If using "tecplot" (refer to http://www.tecplot.com/ ), I'm able to obtain much better result as " input_sample_sphere_radiation_trecplot.jpg".

Can anybody help to load the 3D data file "input_sample_sphere_radiation.dat" without too much sawtooths?
In addition, be kind enough to leave your code as well?

BTW, my code to load it is attached:


1  
2  
3  
4  
5  
6  
7  
gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
gi.setCoordinates(getNodesVertices1());
int[] element = getElements();
gi.setCoordinateIndices(element);
gi.setStripCounts(getStripCount1());
gi.setColors(getColor1());
gi.setColorIndices(element);


Looking forward to your reply.

Best Regards
JIA Pei


6  Java Game APIs & Engines / Java 3D / OrbitBehavior, how to change back to the original view? on: 2010-05-02 02:28:07

Hi, all:

I'm using OrbitBehavior to change the Canvas3D view, namely, I'm trying to view the loaded object in 3D by using OrbitBehavior.

However, my question is: is there a simple way to change back to the original view?
Let's say, the view when I first load an object is the original view V(0),
and after several times of OrbitBehavior actions, the current view now changes to V(N).
The views change from V(0) to V(1) to ... V(N)

How can I change the current view V(N) back to V(0)?

Thanks very much.

JIA



7  Java Game APIs & Engines / Java 3D / Re: java3d in Ubuntu 9.10 can't update screen promptly... on: 2010-04-29 18:01:05

Problem solved.
Refer to

http://forums.java.net/jive/thread.jspa?threadID=79590&tstart=0


Cheers
JIA
8  Java Game APIs & Engines / Java 3D / java3d in Ubuntu 9.10 can't update screen promptly... on: 2010-04-27 18:04:17

Hi, all:

Urgently need your help.

I met this problem long time ago and till now, I couldn't have managed to solve it. Unlike in Ubuntu 8.10, Java3D seems to be incompatible with my current Video driver in Ubuntu 9.10.

I uploaded a video at
http://www.visionopen.com/java3d_ubuntu910.ogv

As shown, Java3D is not able to erase the old leftovers whenever I move the canvas to a different place.


Did anybody meet the same problem and is there a way out to eliminate this terrible problem of display?

Looking forward to your kind and prompt help.

Best best Regards
JIA Pei
9  Java Game APIs & Engines / Java 3D / j3d-core jogl Cg what's wrong? on: 2009-12-29 10:49:45

Hi, all:

I'm using Ubuntu 9.10 with default jogl.jar grabbed from the package repository.

I'd love to recompile j3d-core CVS version downloaded from  https://j3d-core.dev.java.net/ .

However, it looks like the default jogl.jar doesn't afford the following staffs:
1  
2  
3  
CGparameter
CgGL
JoglCgShaderParameter



because all files containing the above staffs won't be able to compile.

Although "ant build.xml" will successfully produce  j3dcore.jar and j3dutils.jar,  this is not the right way out I guess.
I mean, since I installed  "nvidia-cg-toolkit", I'm wondering should j3d-core be able to compile with CG support?
If yes, how to deal with that?

Best Regards
JIA




10  Java Game APIs & Engines / Java 3D / Relationship between .obj file "v values" and on screen 2D coordinate? on: 2009-12-24 16:23:47

Simple .obj specification can be found at
http://www.royriggs.com/obj.html

1  
2  
3  
v x y z

The vertex command, this specifies a vertex by its three coordinates. The vertex is implicitly named by the order it is found in the file. For example, the first vertex in the file is referenced as '1', the second as '2' and so on. None of the vertex commands actually specify any geometry, they are just points in space.



I just want to know, if I created a on/off screen canvas of size 640*480 on my computer screen, what is the relationship between
"v values" of the.obj files and the exact values on the on/off screen canvas Huh
Or, there is no relationship between this two at all?


In my case, my .obj file looks like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
g main
# 75972 vertices.
v -58.1117 -49.4189 -12.242
v -58.0527 -50.0355 -11.9883
v -58.1128 -50.6568 -11.8222
v -58.1629 -51.2563 -11.7768
v -58.2183 -51.8611 -11.7323
v -58.2231 -52.4784 -11.7214
v -58.259 -53.0993 -11.7188
v -58.3331 -53.7061 -11.7407
v -58.3663 -54.309 -11.7328
v -58.3955 -54.9136 -11.7015
v -58.4142 -55.526 -11.6696
v -58.4299 -56.1264 -11.6939
v -58.427 -56.7551 -11.8301
v -58.4213 -57.3728 -12.0565
v -58.8783 -29.3341 -12.3035
v -58.8634 -29.9544 -12.0902
v -58.8288 -30.5471 -11.949
v -58.7427 -31.1332 -11.886
v -58.6354 -31.7285 -11.9012
v -58.5571 -32.331 -11.9593
...
v 55.3262 -54.4387 -11.2943
v 55.3417 -55.068 -11.3683
v 55.3343 -55.6911 -11.5067
v 55.3041 -56.3406 -11.6606
mtllib /.../filename.mtl
usemtl default
vt 0 0.198847 0.0
vt 0 0.195965 0.0
vt 0 0.193084 0.0
vt 0 0.190202 0.0
vt 0 0.18732 0.0
vt 0 0.184438 0.0
vt 0 0.181556 0.0
vt 0 0.178674 0.0
...


I loaded the .obj file like:


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY ; // | ObjectFile.RESIZE; 
ObjectFile f = new ObjectFile(flags, 0.0f);
m_S = null;
try {
   m_S = f.load(fname);
} catch (FileNotFoundException e)
{
        ...
}
m_BGFace = m_S.getSceneGroup();
m_Object3d = (Shape3D)m_BGFace.getChild(0);
Bounds m_ObjBounds = m_Object3d.getBounds();



Now, as you might have noticed, I intended not to use the configuration "ObjectFile.RESIZE; " to avoid automatically resize when loading this .obj file.

Now, m_ObjBounds does show the bounds of this object's "v value list". (well, you may look on the v value list as a point list and calculate its boundary, Java3D Bounds and BoundingBox are pretty useful here )

However, I still can't find any relationship between this "loaded v values" and "on/off screen pixel coordinates".
For sure, there must be some relationship between this two, because Java3D must be able to load data from .obj files and display them automatically on the screen by Java3D itself. isn't it?

So, can anybody tell me, what is the relationship between .obj files' "loaded v values" and "on/off screen pixel coordinates" ??


Best Regards
JIA Pei






11  Java Game APIs & Engines / Java 3D / Re: .obj loading in java3d... on: 2009-12-24 02:45:10

Please refer to http://forums.java.net/jive/thread.jspa?messageID=377273


I found the problem comes from
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY | ObjectFile.RESIZE;

If I revised it to
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY;

This might bring me a non-resize loading, but fail to show it in the screen.

I'm wondering whether I can load it like
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY;

but afterwards, I may add "ObjectFile.RESIZE" back into the loaded Scene so that it should be able to display in the view directly?

Cheers
JIA





12  Java Game APIs & Engines / Java 3D / .obj loading in java3d... on: 2009-12-22 08:19:53
I did notice my .obj file, which must have the true coordinate values like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
g main
# 75972 vertices.
v -58.1117 -49.4189 -12.242
v -58.0527 -50.0355 -11.9883
v -58.1128 -50.6568 -11.8222
v -58.1629 -51.2563 -11.7768
v -58.2183 -51.8611 -11.7323
v -58.2231 -52.4784 -11.7214
v -58.259 -53.0993 -11.7188
v -58.3331 -53.7061 -11.7407
v -58.3663 -54.309 -11.7328
v -58.3955 -54.9136 -11.7015
v -58.4142 -55.526 -11.6696
v -58.4299 -56.1264 -11.6939
v -58.427 -56.7551 -11.8301
v -58.4213 -57.3728 -12.0565
v -58.8783 -29.3341 -12.3035
v -58.8634 -29.9544 -12.0902
v -58.8288 -30.5471 -11.949
v -58.7427 -31.1332 -11.886
v -58.6354 -31.7285 -11.9012
v -58.5571 -32.331 -11.9593
...
v 55.3262 -54.4387 -11.2943
v 55.3417 -55.068 -11.3683
v 55.3343 -55.6911 -11.5067
v 55.3041 -56.3406 -11.6606
mtllib /.../filename.mtl
usemtl default
vt 0 0.198847 0.0
vt 0 0.195965 0.0
vt 0 0.193084 0.0
vt 0 0.190202 0.0
vt 0 0.18732 0.0
vt 0 0.184438 0.0
vt 0 0.181556 0.0
vt 0 0.178674 0.0
...



I read this ".obj" manually in C/C++. However, now, I've got to display this .obj object in java3D.
And, I did it successfully !!

However, my current code looks like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY | ObjectFile.RESIZE;
ObjectFile f = new ObjectFile(flags, 0.0f);
m_S = null;
try {
   m_S = f.load(fname);
} catch (FileNotFoundException e)
{
        ...
}
m_BGFace = m_S.getSceneGroup();
m_Object3d = (Shape3D)m_BGFace.getChild(0);
Bounds m_ObjBounds = m_Object3d.getBounds();


My question is, how can I retrieve values in "v" rather than values in "vt" from variable m_S?Huh?
How can I retrieve the values around tens, but not just retrieve those values between -1.0 and 1.0 ?

Thanks in advance and Merry XMas.
Seriously Urgent.

Please do help.

Best Regards
JIA


13  Java Game APIs & Engines / Java 3D / Re: How to calculate height of the loaded object? on: 2009-12-20 01:58:23

Hi, Thank you so much Tom.
You are always helpful.

I got the bounds of the loaded object.

1  
Bounds m_bounds = m_Obj3d.getBounds();


And the current m_bounds is of value:

1  
2  
3  
4  
5  
6  
7  
8  
lower=Point3d
x=-0.88
y=-1.0
z=-0.67
upper=Point3d
x=0.88
y=1.0
z=0.67


However, as we can see, the bounds are normalized so that the object's longest axis (Y) is normalized to "between -1.0 and 1.0".
I'm still not able to find the value mapping to the screen.
what I mean is
y=-1.0 should be corresponding to around -100 pixels, while
y=1.0 should be corresponding to around +100 pixels.


Can you help please?

Best Regards
JIA



you could try getBounds(). If it is a Shape3D it will be a BoundingBox otherwise it is a BoundingSphere.
14  Java Game APIs & Engines / Java 3D / Re: How to calculate height of the loaded object? on: 2009-12-20 00:15:45

Hi, Thanks elias !!

You are absolutely correct.
[size=15pt]If I'm able to know the distance between the farthest top point to the farthest bottom point,[/size]
I should be able to calculate out the correct size.

You point out what's the key, but you didn't show me the answer !!!
[size=15pt]How can I obtain the coordinate of the farthest top point? and How can I obtain the coordinate of the farthest bottom point?[/size]

Can you give me a clue? I know that getLocalToVworld() might work, but it always gives out the value
1.0 for the farthest top point ,  and the value.
-1.0 for the farthest bottom point.
getLocalToVworld()  doesn't actually consider what is the current canvas size, say 640*480.
getLocalToVworld()  always givems 1.0 and -1.0 for the farthest top and bottom points.

What I need, is not 1.0 or -1.0, I need something representing the row number of this point !!!! For instance, 239 and -157.

Hope you can really help !!!

Best Regards
JIA


I'm not sure what you're using, but if you determine the distance between the farthest top point to the farthest bottom point, and then multiply that by your scaling value, you should have the correct size.

15  Java Game APIs & Engines / Java 3D / How to calculate height of the loaded object? on: 2009-12-19 21:28:05
Hi, all:

Question again.

After loading a Scene, I would like to know the loaded object's absolute height at the very first loading without any further transform yet.
How to do that?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
int flags = ObjectFile.TRIANGULATE | ObjectFile.STRIPIFY | ObjectFile.RESIZE;
ObjectFile f = new ObjectFile(flags, 0.0f);
m_S = null;
try {
   m_S = f.load(fname);
} catch (FileNotFoundException e)
{
        ...
}
m_BGFace = m_S.getSceneGroup();
m_Object3d = (Shape3D)m_BGFace.getChild(0);
Bounds m_ObjBounds = m_Object3d.getBounds();
// Now, I would like to obtain the current size (better in 3 dimensions) of m_Obj3D !!


It seems ".obj" file is stored in a specific format that, the longest dimension is used to normalize the loaded object.
Say, in may case, my .obj is stored in the way that:
since from the top to bottom, the object is longest, longer than the size from left side to right side,
and longer than the size from the front to the back, so, the very top line of the object has the coordinate (y_top = 1.0)
and the very bottom line of the object has the coordinate (y_bottom = -1.0)

However, the size (1.0-(-1.0)=2.0) is corresponding to how many pixels on the screen?

This seems to have nothing to do with getLocalToVworld(), right?

Seriously urgent. Please do help.

Best Regards
JIA
16  Java Game APIs & Engines / Java 3D / Re: Obtain absolute coordinate of a 3D object? on: 2009-12-18 05:46:14

Problem solved.

Refer to http://www.java-gaming.org/topics/obtain-2d-onscreen-projection-coordinate/21715/view.html

Rgds
JIA
17  Java Game APIs & Engines / Java 3D / Re: Obtain 2D onScreen projection coordinate? on: 2009-12-18 05:45:38

Problem solved.
Tom, you are right, use

1  
getLocalToVWorld


Cheers
JIA
18  Java Game APIs & Engines / Java 3D / Obtain absolute coordinate of a 3D object? on: 2009-12-18 01:59:11




Hi, all :

I proposed the question at http://www.java-gaming.org/topics/obtain-2d-onscreen-projection-coordinate/21715/view.html

In fact, my current case is like:

I've got two balls, a bigger one and a small one. The small one is attached to the bigger one at somewhere on the surface.

The bigger ball is rotating, so the small ball on its surface will move (translate).

Thus, my java3D group structure is like :


1  
2  
3  
--TransformGroup of Big Ball(Big Ball)
--------BranchGroup
------------------TransformGroup of Small Ball (Small Ball)



When the big ball rotate, surely, the small ball attached on the surface of the big ball will move,
I mean, there exists on-screen translation.

I would like to know the absolute 3D coordinates of the small ball after the big ball transforms.
And, I would like to know the 2D on screen coordinates of the small ball.
For example, if the on screen canvas is of size 640*480,
I would like to know just in this current frame of image,
where about is the small ball within this 640*480 image? (100, 150) ? Or somewhere else???


Seriously urgent and needs your help.


Best Regards
JIA
19  Java Game APIs & Engines / Java 3D / Re: Obtain 2D onScreen projection coordinate? on: 2009-12-17 05:19:47

Hi,
Is it possible for a cascade of TransformGroups?

I mean, in my case, I've got a
1  
Sphere sphere

which has a corresponding
1  
TransformGroup sphereTrans


However, this sphereTrans belongs to a BranchGroup
1  
m_BranchGroup.addChild(sphereTrans);


Further, this BranchGroup has a corresponding TransformGroup, say
1  
m_TransformGroup.addChild(m_BranchGroup);



Now, I transform(including, rotation, scaling and translating) the top-level TransformGroup, say "m_TransformGroup".
This m_TransformGroup doesn't affect sphereTrans at all. But, sphere has been still transformed !!
This is correct !!!

However, how can I obtain the coordinate of this sphere now?

It looks like the total transform of this sphere  replies on both TransformGroups "m_TransformGroup" and "sphereTrans".

So, what are the exact code that I can use to obtain the coordinate (3D and 2D on screen projection) of "sphere"?


Urgent... Please do help.

Thanks in advance.

Best Regards
JIA




1) correct the coordinates in the geometry is defined in local space. They are transformed into eye space when rendered using the TransformGroups. You can use the the getLocalToVWorld method to get a transform you can use to transform the coordinates into world space, if that is what you are after.

2) There might be something you can use in com.sun.j3d.utils.universe.ViewInfo. Why do you need this information?
20  Java Game APIs & Engines / Java 3D / Re: Hide Sphere -- How to? on: 2009-12-16 19:13:02

Hi, Thanks. problem solved.

Cheers
JIA
21  Java Game APIs & Engines / Java 3D / Re: Obtain 2D onScreen projection coordinate? on: 2009-12-16 17:08:36

Hi, Tom:

Thanks for your reply.
In fact, I would like to produce some .jpg file. I found some code to snap the entire view (onScreenCanvas) into a single .jpg file.

However, I would like to further realize the functionality as:

When I drag the object in the view, the object might move its position form A to B.
Now, I don't want to snap the entire image, I would like to focus on this specific object.
That means, I would like to find a small rectangle, which just contains this object.
And, I snap this small rectangle and save it as my concerned .jpg file.
That's why I've got to know the object's 2D project coordinate(s).

So...
Seriously thank for your answering and should have some further suggestions
after you get to know my purpose, please do not hesitate to give me some further help.

Best Wishes
JIA




1) correct the coordinates in the geometry is defined in local space. They are transformed into eye space when rendered using the TransformGroups. You can use the the getLocalToVWorld method to get a transform you can use to transform the coordinates into world space, if that is what you are after.

2) There might be something you can use in com.sun.j3d.utils.universe.ViewInfo. Why do you need this information?
22  Java Game APIs & Engines / Java 3D / Re: Hide Sphere -- How to? on: 2009-12-16 12:58:45

Thanks very much.

However, what's the relationship between a Switch and the TransformGroup/BranchGroup/Universe?

Because my Sphere sphere is in a TransformGroup, and then a BranchGroup, which is finally shown in the Universe.
How to organize the Switch visibleSwitch and my TransformGroup/BranchGroup/Universe?

Cheers
JIA


1  
2  
3  
4  
Sphere sphere = new Sphere(...);
Switch visibleSwitch = new Switch();
visibleSwitch.addChild(sphere);
visibleSwitch.setWhichChild(Switch.CHILD_NONE);

23  Java Game APIs & Engines / Java 3D / Re: Hide Sphere -- How to? on: 2009-12-16 08:08:32

Hi, do you mean that
a Sphere is able to inherit setWhichChild method?

I tried but error reported:

1  
2  
Sphere sphs;
sphs.setWhichChild(Switch.CHILD_NONE);



So, any further suggestions?

Rgds
JIA


You can add it to a Switch node. Then use setWhichChild(Switch.CHILD_ALL) to show it and setWhichChild(Switch.CHILD_NONE) to hide.

Setting the alpha to 0 will probably be slower since the sphere will still be rendered. Another difference is that using a Switch will disable picking on the hidden children.
24  Java Game APIs & Engines / Java 3D / Obtain 2D onScreen projection coordinate? on: 2009-12-16 08:04:37

Hi, all:

I created a Sphere, and I can drag it as I wish.
The code is like:

1  
2  
3  
4  
5  
6  
7  
8  
Sphere sphs = new Sphere(0.02f, someAppearance);
TramsformGroup sphTrans = new TransformGroup();
sphTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
sphTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
sphTrans.setCapability(Group.ALLOW_CHILDREN_EXTEND);
sphTrans.setCapability(Group.ALLOW_CHILDREN_READ);
sphTrans.setCapability(Group.ALLOW_CHILDREN_WRITE);
sphTrans.addChild(sphs);


I would like to obtain two things:

1) the new coordinate of this "sphs" after I dragged the 3D object randomly.
In my application now, after some rotation and translation, "sphs" changes its position on the screen image, however, it looks its 3D coordinate didn't change at all. So, does that mean, the 3D coordinate won't change even if I dragged it around??

2) How to obtain the 2D onScreen projection coordinates after 3D transformation?
For sure, the 2D on screen coordinate of this "sphs" varies all the time. How can I obtain the dynamic 2D projection coordinates of this "sphs"

Thanks in advance.

Best Regards
JIA






Best Regards
JIA Pei
25  Java Game APIs & Engines / Java 3D / Hide Sphere -- How to? on: 2009-12-16 02:36:28

Hi, all:

I created a Sphere
1  
sphs = new Sphere(0.02f, someAppearance);


In my application, I would like there is a "switch" to display or to hide this Sphere.

But, how to hide a Sphere?
Or, how to set this Sphere 100% transparent?


Please help.

Best Regards
JIA




26  Java Game APIs & Engines / JOGL Development / Re: Gluegen seems never able to be fully compiled... on: 2009-11-26 01:12:23

gcc --version
gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


assuming all the above is nominal..

 gcc --version ?

27  Java Game APIs & Engines / JOGL Development / Re: Gluegen seems never able to be fully compiled... on: 2009-11-26 00:13:32
Thanks for your reply...

$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK Server VM (build 14.0-b16, mixed mode)


jia.
rereading your message i think you're looking at java version problems.
java -version ?

john

28  Java Game APIs & Engines / JOGL Development / Re: Gluegen seems never able to be fully compiled... on: 2009-11-25 21:52:08

In fact, I'm using Ubuntu 9.10, which ships with ant 1.71

Rgds
JIA

fwiw, ant 1.6.5 failed where ant 1.7.1 succeeded (from github/sg repo)

29  Game Development / Game Mechanics / Re: JBullet ant build fail... on: 2009-11-18 00:33:22

Thanks very much.

yes, in my case, jbullet failed to build just because the junit is not favorably set up in build.xml.

Hope you can help at your earliest convenience.

Thanks
JIA
30  Java Game APIs & Engines / JOGL Development / Re: nehe in Eclipse on: 2009-11-17 23:56:21

simple delete nehe and readd it back to Eclipse, now, all "red crosses" disappear.
No idea why it is so but it works fine now.

cheers
JIA
Pages: [1] 2 3 4
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (27 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!