Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (604) Games in Android Showcase (171) games submitted by our members Games in WIP (652) 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 / OpenGL Development / Frustum Values on: 2005-07-21 23:05:34 Would like to pose some questions about frustum numbers, if I may.  My models/Levels are coming out of 3dsMax complete with their position in the level (world space). They also have available a geometric center and the farthest vertex from it, which gives me a bounding sphere also with world space values. For this reason, I want to cull against a frustum that is also in world space. I see two ways of implementing Frustum Extraction for this purpose. First is to get the default values and then transform them each frame to compare to the geometry parameters.  Second is to extract them from the Projection and Model-View Matrices each frame and compare.   In the first implementation, there are several sub-cases. First, I could start with the NDC values and transform them up the pipeline to world space.  This would require reversing the whole pipeline to include viewport transform and perspective division. Second, I could extract them from the initial projection matrix times the model-view (which is identity at this point), which should be in view/clip space. Again, transforming them to world/eye/camera space for culling. Q: Am I correct in equating world/eye/camera space? I feel it is likely since the position of objects in the scene is based on their position relative to the view point/camera.  Third and finally, there is a set of equations (Eric Lengyel’s book Mathematics for Game Programming and Computer Graphics) that allow you to extract the frustum plane values from the parameters passed to either glFrustum or gluPrespective.   In the second implementation, the literature says that the matrix resulting from the cross product of the projection and the model-view can be used to extract the instantaneous plane values through row multiplication.   The problem I’m having is that with the exception of implementation 1, case 3 I do not end up with numbers that look like “world” numbers.  From it I get the following with fovy = 45, near clip = 0.1, far clip = 2000, and aspect = 1.333… (1024/768):   Plane[A:0.15425146 B:0.0 C:-0.9880316 D:0.0]                    Plane[A:-0.15425146 B:0.0 C:0.9880316 D:0.0]                    Plane[A:0.0 B:-0.11629547 C:-0.99321467 D:0.0]                    Plane[A:0.0 B:0.11629547 C:-0.99321467 D:0.0]                    Plane[A:0.0 B:0.0 C:1.0 D:2000.0]                    Plane[A:0.0 B:0.0 C:-1.0 D:-0.1]The other methods yielded values that were 0 or near 1;  even the ones above when transformed with a variety of matrix combinations reverted to similar values.     The second implementation yields similar sorts of numbers. Q: So how do I get frustum planes that rotate and translate with the view point and will allow culling in world space?
 2 Java Game APIs & Engines / Java 3D / Re: Multi-texturing/Multiple Textures on: 2005-04-28 10:34:50 Thanks for the reply.  It's kind of disappointing. Considering that one of the things I've seen that helps with speed is limit the # Shape3Ds.  So it may work the way I expect it to some time in the future when video cards can handle that many textures.  But now no way. I was getting a lot of slowdown with terrain and a dozen buldings.  Have to get out a ways before fog, etc has a chance of being realistic. Explore all the other ways of cutting overhead. It does explain the phenomena of the higher indexed texture predominating(FIFO).  Guess it's a pitfall of using a high level of abstraction, that you can fall into the trap of forgetting about the hardware.ThanksJim
 3 Java Game APIs & Engines / Java 3D / Re: Multi-texturing/Multiple Textures on: 2005-04-28 01:38:58 I've always been able to do it by breaking up the geometry and creating a Shape3D for each sub-unit but that makes for a lot of Shape3Ds (5-9/shape for simple buildings). When you consider that a Shape3D can have more than one geometry and the texcoordSetMap in each one should be able to select only those textures used in it, it should work.  Also each GeometryArray can have many sets of verts, normals and texture coords; with the texCoordSetMap selecting the TUS(s) for each TCSet.Surely all this functionality is not there so you can gather all the "Blue Trim" e.g. geometry in one Shape3D.  That is useless and counter productive to things like animation. Read the docs and tutorials on the texCoordSetMap in GeometryArrays and how it's supposed to work. That's the indexing I'm talking about.
 4 Java Game APIs & Engines / Java 3D / Multi-texturing/Multiple Textures on: 2005-04-24 10:55:39 Having a lot of problems with both kinds of multi-texturing.  First, the ability to place different textures on differing faces of an object. Second, the ability to place more than one texture on a given face.  Then of course there is doing both at the same time.  The only way I seem to be able to do this is to split up my geometry and build a separate shape3D for each part with an appearance which hold only those TextureUnitStates that are used in that sub-geometry. This leads to a lot of Shape3D objects.I tried doing the first type by stacking the verts, normals and texcoords into one geometry array and using the initial vert index (in the texcoord adding method) to point to the starting vert effected.  Then mapping the texcoord sets to TextureUnitStates in the Appearance object holding all the textures for the Shape3D.  This resulted in the highest indexed TUS texture being shown on all faces of the shape.Alternately, I tried doing a combination by creating one Appearance with all the textures and placing the sub-geometries in their own geometry arrays, which were added to the Shape3D.  The texcoordset to TUS map for a one of these Geometry array would typically look like this:[code]Index      Value0      -11      -12      03      -14      -15      1[code]In this case too the highest indexed TUS texture seemed to predominate.  The docs say that using -1 prevents that TUS from being used in that geometry array.  The map above should be equivalent to using an Appearance with 2 TUS and a map of {0,1}.  Of course this requires more Shape3Ds.      However, that does not seem to be the case.  If an Appearance object includes TUS not used in a particular sub-geometry then there seems to be some bleed-over.  The highest indexed TUS always predominate.      Is there a capability bit I'm missing, a Texture/Rendering/etc attribute I'm missing?  I'm using DECAL for the base texture and COMBINE_ADD for the second which is a lightmap.
 5 Java Game APIs & Engines / Java 3D / Re: ASE Loader (texture problem) on: 2005-04-13 11:35:29 Is this the kind of multi-texture where you have different single textures on different faces of an object? Or the kind where you put more than one texture on the same face.If type one, you have to break up the geometry so each sub-shape has one base texture.  If you use TextureUnitStates, you can apply more than one texture to all the faces of this subshape.Texture unit states is how you add more than one texture to the same faceJim
 6 Java Game APIs & Engines / Java 3D / Re: ASE Loader on: 2005-04-12 12:12:43 Hey looked at some of your source and saw that you in deed had some animation frames.  Did you build those from the data in the ASE file?  Haven't seen this done before and have always been told that ASE doesn't support animation.Jim
 7 Java Game APIs & Engines / Java 3D / Re: Branchgroup RemoveChild on: 2005-04-12 12:01:40 The capability ALLOW_DETACH is only available in branchgroup.  Drop children only if ALLOW_CHILDREN_WRITE is set. Then set it to null in the branchgroup.If you want a detachable leaf hang it off a branchgroup which can be detached.
 8 Discussions / General Discussions / SceneGraphObjects aquiring parents without add on: 2005-04-12 11:46:49 Has anyone else encountered a situation where upon adding a newly constructed SceneGraphObject you get the "Multiple parent exception"?First ran into this when constructing an array of Shape3Ds in a class designed to handle the data for a single model. When I used a 'for' loop to iteratively add the shape3ds to a transform group I got the error on the first addChild. The parent (using getParent()) was a TranformGroup. I solved this by having my model class only supply the GeometryArray and Appearance and building the shape3ds in the 'for' loop at attachment.Now I am encountering the same problem with Backgrounds, with no convienent work-around.Jim
 Pages: [1]
 SHC (23 views) 2015-08-01 03:58:20 Jesse (19 views) 2015-07-29 04:35:27 Riven (39 views) 2015-07-27 16:38:00 Riven (21 views) 2015-07-27 15:35:20 Riven (24 views) 2015-07-27 12:26:13 Riven (14 views) 2015-07-27 12:23:39 BurntPizza (35 views) 2015-07-25 00:14:37 BurntPizza (46 views) 2015-07-24 22:06:39 BurntPizza (28 views) 2015-07-24 06:06:53 NoxInc (36 views) 2015-07-22 22:16:53
 theagentd 51x wessles 45x basil_ 35x KaiHH 26x orangepascal 26x ags1 21x Riven 19x mooman219 17x bornander 14x KudoDEV 13x CelestialCreator 11x princec 11x klaus 11x Jesse 11x pquiring 9x chrislo27 8x
 List of Learning Resourcesby gouessej2015-07-09 11:29:36How Do I Expand My Game?by bashfrog2015-06-14 11:34:43List of Learning Resources2015-05-31 05:37:30Intersection Methodsby Roquen2015-05-29 08:19:33List of Learning Resources2015-05-05 10:20:32How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21
 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