Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
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]
1  Java Game APIs & Engines / Xith3D Forums / Re: keep "camera" from running through w on: 2004-03-10 10:45:05
Printing out your bounds manually may help to check exactly what is happening:

e.g.:

1  
2  
3  
4  
                  System.out.println("VWbounds View:" + dummyView.getVworldBounds().toString());
                  System.out.println("VWBounds Shape:" + shape.getVworldBounds().toString());
                  System.out.println("View:" + viewBounds.toString());
                  System.out.println("Shape:" + cubeBounds.toString());


If not perhaps as suggested it might be something to do with clipping.

2  Java Game APIs & Engines / Xith3D Forums / Re: keep "camera" from running through w on: 2004-03-10 07:49:50
Um have you tried - colliderNode.setTwoSided(true);?
Just a guess I'm afraid.

I've had the same sort of problem I think.  I've been testing for specific collisions between the dummy view and say a xith cube using sphereIntersect() in the Sphere class.  I get the right collision detected, but only if I hit the exposed bottom of the cube, not any point on the cube e.g. the top or higher up each side - I have tried playing with the BoundingSphere and the collisionNode values of the xith cube which doesn't seem to do anything.
3  Java Game APIs & Engines / Xith3D Forums / Re: shapes around view :) on: 2004-02-28 08:48:33
Thanks Smiley

It kind of works now - I can detect a collision when I'm moving in a certain direction at my cubes.  

It seems if both cubes are in the frustum they seem detectable but not if they they aren't.  I probably need to do some testing to see what is exactly happening.  I do have collision attached to everything + I'm using terrain.

I couldn't see any methods to detect/test if Collision Nodes intersect/hit each other - that is why I'm trying to do it this way.

I'm a bit further forward - thanks again Smiley

4  Java Game APIs & Engines / Xith3D Forums / Re: shapes around view :) on: 2004-02-27 20:11:40
Thanks  Smiley

So instead if I wanted to find out if my view collides /intersects with a shape I would say something like:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
//dummyView & shape1 are Shape3D's with BoundingSpheres
if (dummyView.getVworldBounds().sphereIntersection(shape1.getVworldBounds()))
            {
                  System.out.println("collision shape1");
            }

            else if (dummyView.getVworldBounds().sphereIntersection(shape2.getVworldBounds()))
            {
                  System.out.println("collision shape2");
            }


But if I add another shape (shape2 above) & look to see if my view collides with this new one nothing seems to register with println()s - presumably because both shapes are in my frustum.

Do I need to somehow culling everything I have apart from the intersection I'm testing for?
Is this what you mean by:

Quote
take a look for View.java in Xith3D source tree - it performs frustum culling to avoid rendering of definitely invisible objects.


Thanks again.
5  Java Game APIs & Engines / Xith3D Forums / Re: shapes around view :) on: 2004-02-27 14:22:47
Sorry newbie Question...

Quote
Classifier can classify if bounds are inside/outside/intersect classifying shape.


Given this is how Classifier works, & given that I have a moving view (with a BoundingSphere) & a cube (with a BoundingSphere) how would I sense when the view enters that particular cube?

For example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
      public void detectCol()
      {
            //viewBounds is BoundingSphere with the view &
           //Cube1Bounds is the BoundingSphere with the cube
           Classifier.Classification classifyCube1 = viewBounds.classify(cube1Bounds);
            Classifier.Classification classifyCube2 = viewBounds.classify(cube2Bounds);

            if ( ( classifyCube1 == Classifier.INSIDE ) ) {
                  System.out.println("collision shape1");
            }

            if ( ( classifyCube2 == Classifier.INSIDE ) ) {
                  System.out.println("collision shape2");
            }


The method is called in my render loop to check for the collision.

Please what am I doing wrong? Sad
6  Java Game APIs & Engines / Xith3D Forums / Re: TerrainTest pick mod on: 2004-02-26 11:08:33
Do you mean to select one of the IndexedTriangleArray's which make up the terrain in Michael Wright's Demo?

Just a thought but if you could set the Shape3D which displays the IndexedTriangleArray which defines the terrain to piackable - I think it's in the TerrainShape() constructor - then you just set its colour when you click it?

Sorry if that doesn't make much sense, I'm new to xith.  Smiley
7  Java Game APIs & Engines / Xith3D Forums / Re: Xith.org is down ? on: 2004-02-26 07:47:15
ditto  Sad
8  Java Game APIs & Engines / Xith3D Forums / getBounds()/intersect() problem on: 2004-02-23 14:42:19
At the moment I have a terrain with a cube in it with a view collider based on David Yazels Movement class from his Quake3Loader classes and demo.  

I want to return a String (using println) to say they have collided when they do.  All the collision stuff works fine, I just want to return something when the collision happens between the view and cube.

My current effort revolves around using Bounding objects.  In the code below viewBounds is a BoundingSphere and cube1Bounds is a BoundingBox.  I've put it in the render loop so it's checked each render.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
       public void runTest()
      {
          long startTime = -1;

          while (true)
                           {
                            if (viewBounds.intersect(cube1Bounds) == true)
                             {
                                                 System.out.println("collision");
                             }
      .
      .
      .
      .
      }




At the moment it just returns the string regardless of if the Bounding objects intersect.  Am I going in the right direction with this?  

Does a better way to do this occur in the collision packages, do I need to to check this intersect somewhere else or I am just using faulty logic?

Thanks.

9  Java Game APIs & Engines / Xith3D Forums / Re: Querying scenegraph created using Quake3Loader on: 2004-02-18 07:00:02
Thanks, but I think what I'm looking at eventually can't be done.  The Quake BSP format and the loader/converter does not have any ability to produce any sort of identifier I can use to get hold of a particular Java/xith/scenegraph reference.  

I want to recognise individual collisions in a scene to bring up awt dialogues when they happen e.g. walking into a tree.  Unfortunately this is impossible as an individual tree in a scene can not be distingushed as far as I can see.

The suggestions given allow me to get the children in the scenegraph Smiley but ultimately the information doesn't contain what I need to accomplish my task. Sad

Back to ASE I guess.
10  Java Game APIs & Engines / Xith3D Forums / Re: Level editors/loaders on: 2004-02-16 14:40:30
See this:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1074907427

Pretty cool Quake3 map Loader.  Map was created using qeradiant.
11  Java Game APIs & Engines / Xith3D Forums / Re: Multi-Story House on: 2004-02-16 14:37:34
Have you seen the Quake3Loader example posted a couple of weeks back which uses a dummy node to allow you to navigate with the view?

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1074907427
12  Java Game APIs & Engines / Xith3D Forums / Querying scenegraph created using Quake3Loader on: 2004-02-16 14:27:32
I've been playing with David Yazel's Quake loader he kindly made available a couple of weeks back, and was wondering if it was possible to query the scenegraph the loader converts the Quake 3 map into.

At the moment I've been trying things like this to return the children from the scenegraph which holds the Quake map:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
BranchGroup scene = createSceneGraph();
        
            Enumeration e = scene.getAllChildren();
            while(e.hasMoreElements())
            {
                  System.out.println("printing sg elements: "+e.nextElement());
            }
            locale.addBranchGraph(scene);

        runRenderer();


This seems to return less children than I expected.

Is it possible to do this, so I could potentially pick out objects from the Quake bsp map using xith?

Thanx


E.
13  Java Game APIs & Engines / Xith3D Forums / Re: Quake 3 demo released on: 2004-02-01 13:58:55
This might be a bit stupid Embarrassed (but bearing in mind I was new to Quake mapping until about 2hrs ago) I found that you must use an info_player_start to get the quake loader to work when creating your own map start point.  I was using a info_player_deathmatch as in the radiant basic tutorial which is why I had no success.

The excellent demo works well with maps I have created this afternoon. Smiley
14  Java Game APIs & Engines / Xith3D Forums / Re: Quake 3 demo released on: 2004-02-01 11:35:06
I think I've seen the level used in the demos included in Radiant 1.4.

I've been playing about with the demo to try & load other maps with no luck what so ever.  Do you have to compile them in a certain way?  I'm using radiant - which I'm totally new to.


E.
15  Java Game APIs & Engines / Xith3D Forums / Recognising a collision. on: 2004-01-30 13:24:46
If I wanted to find when 2 particular collision nodes collide (e.g. the view & a tree) & then produced notification e.g. An awt dialogue when this happen, how would I do this or rather test for this?


EBTTRT
16  Java Game APIs & Engines / Xith3D Forums / Re: Quake 3 demo released on: 2004-01-25 08:26:58
Wow  Smiley

Very nice.
17  Java Game APIs & Engines / Xith3D Forums / Re: Instructions on building a View collider on: 2004-01-25 07:06:14
Thanks for posting.  Can't wait to see the quake demo.


Smiley
18  Java Game APIs & Engines / Xith3D Forums / Instructions on building a View collider on: 2004-01-23 14:12:45
Anybody know how far the collision detection goes?

I have no problem writting similar test to DavidYazel's but when it comes to adding collision to a view or an object navigating using awt events to code compiles but does nothing. Huh

Please someone tell me I'm being stupid Smiley
19  Java Game APIs & Engines / Xith3D Forums / Re: Xith3DTerrainTest and Textures on: 2004-01-23 11:27:44
Try a 1pixcel by 1pixcel image (say green) & you should see some colour on your terrain.  Then you should have a green terrain - but no detail of course.
This is how I assumed something strechy was taking place somehow.  This as far as I got.  
It's the triangles thing I was on about which needs solving to get good terrain like grass, stone, etc...  

In the demo if you switch to the line mode & see the triangles - these individually need texturing I think.

I'm probably not being much help, just adding moral support I hope!
20  Java Game APIs & Engines / Xith3D Forums / Re: Collision detection classes on: 2004-01-20 12:53:09
This is driving me a bit mad  Sad

I'm trying to navigate around as the camera the ASE file I have loaded up - which is a basic room.  I have added a CollisionNode to the rightwall, so when I translate hopefully I'll hit it.  I've also added a CollisionNode to the TransformGroup holding the view.  Nothing changes  Huh
I've tried quite a lot of things, but here's the basic code without all the fiddly hacks.  
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  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
public class ColTest04 implements KeyListener
{
      TransformGroup objTranslate = null;
      Transform3D translate = null;
      TransformGroup objRotate = null;
      Transform3D rotate = null;
      TransformGroup room = null; //entire room
     TransformGroup rightwall = null;
      View view = null;
      Canvas3D canvas = null;
      Vector3f position = new Vector3f(0.0f, 15.0f, 0.0f);
      Vector3f angle = new Vector3f(0.0f, -90.0f, 0.0f);
      CollisionSystem cs = new CollisionSystem(-1);


      public static void main(String[] args)
      {
      try
        {
            ColTest04 test = new ColTest04();
        }
      catch(Exception e) {}
      }


      public ColTest04() throws Exception
      {
            TextureLoader.tf.registerPath("./");

            VirtualUniverse universe = new VirtualUniverse();
            view = new View();
            universe.addView(view);

            Locale locale = new Locale(5.0f, 0.0f, 10.0f);
            universe.addLocale(locale);

            BranchGroup scene = new BranchGroup();
            locale.addBranchGraph(scene);

            //load ASE file
           AseFile af = new AseFile();
            BufferedReader br = null;
            try
            {
                br = new BufferedReader(new FileReader("2ndgo.ASE"));
            }
            catch(IOException e)
            {
                URL url = getClass().getClassLoader().getResource("2ndgo.ASE");
                br = new BufferedReader(new InputStreamReader(url.openStream()));
            }
            AseReader r = new AseReader(br, af);
            af.parse(r);

            HashMap namedNodes = new HashMap();
            room = af.getTransformGroupTree(namedNodes);
            scene.addChild(room);

            Collection c = namedNodes.keySet();
            for(Iterator i = c.iterator(); i.hasNext(); System.out.println(i.next()));

            //add collision to rightwall
           rightwall.setName("rightwall");
            ColliderGeometry cgRightWall = new ColliderGeometry();
            cgRightWall.setModel(rightwall);
            BiTreeCollider bic = new BiTreeCollider();
            bic.build(cgRightWall);
            ColliderNode rightwallNode = new ColliderNode(rightwall, ColliderNode.CT_GEOMETRY,
                  ColliderNode.CT_GEOMETRY, false, bic);
            cs.addCollider(rightwallNode);

            //create tranform node to hold view & let view along this path translate
           translate = new Transform3D();
            objTranslate = new TransformGroup(translate);
            translate.setTranslation(position);
            objTranslate.setTransform(translate);
            scene.addChild(objTranslate);
              
            // let view along this path rotate
           rotate = new Transform3D();
            rotate.rotXYZ(0.0f, 0.0f, 0.0f);
            objRotate = new TransformGroup(rotate);
            objRotate.setTransform(rotate);
            //make it a child of TransformGroup/objTranslate
           objTranslate.addChild(objRotate);

            //add collision to transform node which holds view
           objTranslate.setName("view");
            ColliderGeometry cv = new ColliderGeometry();
              cv.setModel(objTranslate);
            BiTreeCollider bic2 = new BiTreeCollider();
            bic2.build(cv);
            ColliderNode viewNode = new ColliderNode(objTranslate,
                  ColliderNode.CT_ELLIPSOID, ColliderNode.CT_GEOMETRY, true, bic2, new Coord3f(0,0,0));
            Force gravity = new ForceGravity();
            viewNode.addForce(gravity);
            cs.addCollider(viewNode);

            
            // create a canvas for our graphics
           RenderPeer rp = new RenderPeerImpl();
            CanvasPeer cp = rp.makeCanvas(null, 640, 480, 16, false);
            canvas = new Canvas3D();
            canvas.set3DPeer(cp);

            cp.getComponent().addKeyListener(this);
      
            // modify our view
           view.addCanvas3D(canvas);

            start(view);
      }


      private void moveCamera(Vector3f position, Vector3f angle)
      {
            translate.set(position);

            rotate.rotY((float) Math.toRadians(angle.y));
            translate.mul(rotate);

            rotate.rotX((float) Math.toRadians(angle.x));
            translate.mul(rotate);

            rotate.rotZ((float) Math.toRadians(angle.z));
            translate.mul(rotate);

            view.setTransform(translate);
      }


      public void start(View view)
      {
            while (true)
            {
                  moveCamera(position, angle);

                  view.renderOnce();

                  cs.newFrame(10);
            }
      }



    public void keyPressed(KeyEvent e)
    {
      if(e.getKeyCode() == KeyEvent.VK_LEFT)
        {
            angle.y = angle.y + 5.0f;
        }
      //etc........................
   }

    public void keyTyped(KeyEvent e) {}

    public void keyReleased(KeyEvent e) {}

}



I think the solution is something to do with view & the registration of the CollisionNode for it.  But I could be wrong.

Thanks.
21  Java Game APIs & Engines / Xith3D Forums / Collision detection classes on: 2004-01-19 11:01:03

I'm currently trying to get get my camera/view to navigate around a room (an ASE file) in xith using the recent collision detection classes which were added.

How in theory would I do this?

I have created references to each wall & the floor in my room from the ASE file.  Do I need to add CollisionCodes to each wall & then add a CollisionNode to my camera/view via its Transform node & then finally add these to the CollisionSystem?

If I do I can't seem to get it to work.

Any help as usuall will be gratefully recieved. Smiley
22  Java Game APIs & Engines / Xith3D Forums / Re: View Rotation Transfom Problem on: 2004-01-19 09:37:08
Got the basis.

This was very useful - http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1070332396 for anyone attempting the same thing.
23  Java Game APIs & Engines / Xith3D Forums / Re: View Rotation Transfom Problem on: 2004-01-16 07:32:50
Ok thanks.   Smiley

I've just looked up mul() in my Java3D docs & this will multiply matrices presumally to get the correct distance as you you say between the figure & your following camera view.

If you just wanted to fly around from the view/camera perspective would you just ignore the first two lines and keep applying the position of your transform groups(which hold the view) in view.setTransform(transformgroupMatrixValue)?  No need to use lookAt() to set or update anything?

Is it that easy? Huh

24  Java Game APIs & Engines / Xith3D Forums / Re: View Rotation Transfom Problem on: 2004-01-15 14:26:33
Further to above I had a look at an old Java 3D tutorial as I thought it might help as not much on xith is currently about & it seems you can add a view to a transform node & I've done so in xith (but I'm still far away from accomplishing my task).  Is this the right way to go about navigating in the first person?

Would you need to keep passing the location of the 2 transform nodes holding rotations & translations of the view to lookAt()? But then again lookAt() only holds co.ordinates & not rotations.

Just thinking out loud :-/
25  Java Game APIs & Engines / Xith3D Forums / Re: View Rotation Transfom Problem on: 2004-01-14 16:17:03
I've had the same sort of problem with trying to translate.  I don't think you can do what you want as the lookAt() method will take co-ordinate positions for the view & will have nothing to do with rotations, but saying that I get the same problem you described & I want to rotate as well as translate.

Handy if you could put the view into a transform node & then do the tranlations/rotations on this Smiley, but I suppose this isn't possible Sad

I want be able to move around using a first person perspective (rotate in Y & translate in Z).

Any suggestions as to the general way to accomplish this in xith will be gratefully recieved. Smiley  For example what needs to be called in the render loop to move the view to make it dynamic rather than static as it is in the tutorials using lookAt().

26  Java Game APIs & Engines / Xith3D Forums / Re: Xith3DTerrainTest and Textures on: 2004-01-06 14:15:13
I started that particular link, but have moved on without finding a solution. Sad

The Demo does actually work - it just stretches the image across the entire terrain so you get no detail.  

What I need to work out is how to tile each triangle with an image just to get some detail.  I'm not experienced in graphics but I assume it would not be a good idea to try to put a huge detailed image over the huge terrain.

So tiling the triangles & then giving each a certain level of detail depending if they are in view, close or a long way away I think is the best way.
27  Java Game APIs & Engines / Xith3D Forums / Re: Texturing Terrain on: 2003-12-03 18:28:08
Found this interesting post from 2/3 weeks ago which might help us a little:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1069058608;start=5#5

I'm really looking to just place textures on the whole thing or better still have three different textures depending on the height, a bit like the results of terrain generators mojo created in his jME 0.1 that allowed you to do this.
28  Java Game APIs & Engines / Xith3D Forums / Texturing Terrain on: 2003-12-03 13:38:43
Does anybody know a surefire way to apply a texture to Terrain?

I've only seen one example & this doesn't seem to work.  


Thanks
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (51 views)
2014-09-09 02:24:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!