Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
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
1  Java Game APIs & Engines / Xith3D Forums / HUD-like shape selection display on: 2004-08-16 19:30:09
I'd like to create a display for my program that highlights shapes in the field of view by drawing a broken square around the shapes. By broken square, I mean, 4 corners with no midsections, like you see in combat flight sims etc. Creating the billboards and drawing the square is easy but my shapes lie on rolling terrain and I want the square to always be visible and never obscured by the terrain. So a shape on level ground should have the entire square around it eventhough the billboard may be partially underground. Similarly, a shape on the other side of a mountain range should be drawn completely and not obscured in any way. Whats the best way to accomplish this in Xith?
2  Java Game APIs & Engines / Xith3D Forums / Re: Multitexture multiple textures acts strange on: 2004-05-05 13:31:14
I'm using a Radeon 9800 Pro. I think it has support for up to 5 textures (?). I looked at the DecalGroup tutorial but I'm not sure how I can apply those concepts to my terrain. It looks like in the sample source there are a number of textured quads overlaid on one another. I'm applying my textures across the entire terrain so I don't want to store all that data multiple times. I guess I'll have to do pre-generation of the image and apply it to the base texture.  
3  Java Game APIs & Engines / Xith3D Forums / Re: extracting the up vector from a Transform3D on: 2004-05-04 20:15:21
Nevermind, I found the matrix4f function
4  Java Game APIs & Engines / Xith3D Forums / extracting the up vector from a Transform3D on: 2004-05-04 18:45:54
I'm using NodeUpdater's preRender method for some stuff and I want to know if its possible to extract the up vector from the viewTransform parameter.
5  Java Game APIs & Engines / Xith3D Forums / Multitexture multiple textures acts strange on: 2004-05-04 16:57:35
I have a terrain object that is multitextured with 3 textures. One is the base texture, it rarely changes. The other two are regenerated often (after mouse release and so forth). Originally there were only two textures, the base and one changing texture but I am working on adding the 3rd. The problem is, the addition of the 3rd texture causes the terrain to turn black at about 50% transparency. I checked the generated texture image and it is fine. Also, if I replace the original changing texture, everything works fine. Here is how the terrain textures are initially setup:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
 TextureUnitState[] texUnitStates = new TextureUnitState[] { new TextureUnitState(null, null, null), new TextureUnitState(null, null, null), new TextureUnitState(null, null, null) };
                                                                                                                                                             
... (other intialization for the class) ...

    geo = new IndexedTriangleArray(
        MAX_VERTICES,
        GeometryArray.COORDINATES | GeometryArray.NORMALS | GeometryArray.COLOR_3 | GeometryArray.TEXTURE_COORDINATE_2 |
        GeometryArray.BY_REFERENCE,
        texUnitStates.length, new int[texUnitStates.length], MAX_INDICES);

...


    TextureAttributes texAttribs = new TextureAttributes();
    texAttribs.setTextureMode(TextureAttributes.NICEST);
                                                                                                                                                             
    texUnitStates[0] = new TextureUnitState(tm.getTexture(), texAttribs, null);
    a.setTextureUnitState(texUnitStates);
                                                                                                                                                             
    shape = new Shape3D(geo,a);


texUnitStates[1] and texUnitStates[2] are the textures that are updated. I do this by removing the old texture and generating a new one with Java2D buffered images, then adding the texture with this method. texIndex is the index into texUnitStates above:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
  public void addTexture(Texture texture, int texIndex) {
                                                                                                                                                             
    System.err.println("addTexture(" + texture + ", " + texIndex + ")");
                                                                                                                                                             
    TextureAttributes texAttribs = new TextureAttributes();
    texAttribs.setTextureMode(TextureAttributes.NICEST);
                                                                                                                                                             
    TextureUnitState texUnitState = new TextureUnitState(texture, texAttribs, null);
                                                                                                                                                             
    TransparencyAttributes transAttrib = new TransparencyAttributes();
    transAttrib.setMode(TransparencyAttributes.BLENDED);
    transAttrib.setTransparency(0.5f);
                                                                                                                                                             
    Appearance appearance = shape.getAppearance();
    appearance.setTransparencyAttributes(transAttrib);
    texUnitStates[texIndex] = texUnitState;
    appearance.setTextureUnitState(texUnitStates);                                                                                                                                                              
                                                                                                                                                             
    shape.setAppearance(appearance);
  }


and to remove the texture:

1  
2  
3  
4  
5  
6  
  public void removeTexture(int texUnitStateIndex) {
    texUnitStates[texUnitStateIndex] = new TextureUnitState(null, null, null);
    Appearance appearance = shape.getAppearance();
    appearance.setTextureUnitState(texUnitStates);
    shape.setAppearance(appearance);
  }


The problem is, with the addition of the third texture, when the add and remove methods are called, the whole terrain shape turns black. The first two textures appear on the shape but the last (and newest) texture does not. As I said, if I go back to loading just the two textures, then the new texture will load fine. Has anyone seen this before?
6  Java Game APIs & Engines / Xith3D Forums / Re: Picking intersection on: 2004-04-20 17:36:41
I don't think it can be done with the way picking is setup now (ie you just get a list of nodes). You didn't mention your exact problem but perhaps you could solve it by making smaller and smaller portions of your model branchgroups pickable? For example, the arm on the model versus the entire model.
7  Java Game APIs & Engines / Xith3D Forums / Re: Having a node follow the view? on: 2004-04-12 18:58:18
I could potentially update my billboards in the main rendering loop but I'd have to open all sorts of holes in my classes to allow for that, which is why I haven't done it. I guess if I set my billboards at the small end of the scale and then scale them up, there's no chance that they would go out of view. I'm gonna try it.
8  Java Game APIs & Engines / Xith3D Forums / Re: Having a node follow the view? on: 2004-04-12 18:07:50
I was trying to figure out something similar. I wanted my billboards to grow dynamically with respect to the camera's distance. NodeUpdater seemed like a good choice except that the javadoc for it states:

1  
Node updater interface is designed to allow special code to adjust a node's appearance if it is going to be rendered. This should *not* be used to adjust a transform since these methods are only called if the renderer has determined that the node is within view...


Which sounds as if you could perform your transform and end up with a node outside of view when it was already in view previous to the transform. I never found a good way to do the updates automatically with camera motion but if you did this without any problems, I may try it. Does anyone have a better solution they'd like to share?

9  Java Game APIs & Engines / Xith3D Forums / Textures applied to billboards are backwards on: 2004-04-08 17:04:12
Some time ago I noticed that if I draw a texture in a Graphics2D object and then use that texture on a Billboard in Xith, that the texture is displayed reflected. Originally I resolved this using an AffineTransform but that was very annoying so I ended up changing the Xith code in Billboard.java to this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
        /* The original code
        tex[0].set(0, 0);
        tex[1].set(1, 0);
        tex[2].set(1, 1);
        tex[3].set(0, 1);
        */


        tex[0].set(0, 1);
        tex[1].set(1, 1);
        tex[2].set(1, 0);
        tex[3].set(0, 0);


Adjusting the texture coordinates allowed me to draw on the Graphics2D using the normal coordinate system and then get the correct display on the billboard after the texture is applied. Has anybody had problems with this before? It seems to be a bug.
10  Java Game APIs & Engines / Xith3D Forums / Re: Model scale on: 2004-04-08 16:56:56
I do the same. Above the model branchgroup, just add a tranform and adjust its scale. Works very well for me.
11  Java Game APIs & Engines / Xith3D Forums / Re: 2D map in 3D optimizations on: 2004-04-08 16:55:50
This is a very general question and so I'm sorry if my response too is general. Any space partitioning algorithm that works for 3D should have an equivalent in 2D. For example, you could use a quadtree to partition your map into smaller and smaller subsections and then display visible one's based on view. If you're using Xith, some of this stuff should be taken care of for you.
12  Java Game APIs & Engines / Xith3D Forums / Re: Transparency in ASE files on: 2004-03-31 14:34:13
Thanks for the info. If its a bug in the ASE loader I'd look to fixing that before I'll go to manipulating the code, for reasons stated above. What about any of the other loaders have people had trouble using alpha with them? I'm not married to ASE, if some other format works in Xith, I'll use that.
13  Java Game APIs & Engines / Xith3D Forums / Re: Transparency in ASE files on: 2004-03-30 14:33:34
If the default RenderingOptions do not suffice, then perhaps there is a problem. I *really* do not want to set the appearances up by hand because I want to be able to switch out the model (and its texture) in the future without worrying about the structure of the BranchGroup that the model consists of. The model I'm using here was a test, future models will probably be more complex. I suspect its something to do with the way its exported from 3DS but I'm not proficient enough with that software to figure it out (so far).
14  Java Game APIs & Engines / Xith3D Forums / Re: Xith and Swing on: 2004-03-30 14:30:09
If what you mean is add a Xith canvas to a swing GUI, all you have to do is add the canvas to you JFrame, JPanel, whatever just like any other component.

1  
CanvasPeer canvasPeer = renderPeer.makeCanvas(this, canvasWidth, canvasHeight, 32, true);


Where this is, in my case, a JPanel.
15  Java Game APIs & Engines / Xith3D Forums / Updating objects based on view on: 2004-03-30 14:24:23
I've created a label class that contains a billboard, a scale transform, and a location transform. Instances of this class are associated with models (It displays information above the model). The billboards work great but I need to adjust their scale based on their distance from the camera. I see that Billboard implements GeometryUpdater but I don't see how I can extend Billboard and maintain my location and scale transforms. I also found NodeUpdater but the docs say specifically that its not for updating transforms. Are there other ways of updating a node dynamically based on view? Perhaps something I can add to my Label class (which extends BranchGroup)?
16  Java Game APIs & Engines / Xith3D Forums / Transparency in ASE files on: 2004-03-30 13:15:56
I'm trying to load an ASE file that is textured with an alpha transparent texture. I used a texture thats half fully-transparent and half opaque. The result is that the transparent portions are black and completely opaque. Are there special features of 3ds that I need to enable such that when the model loads, the transparency is done correctly? I thought from previous experience that Xith considered an alpha of 255 to be fully transparent and so I inverted the texture's alpha layer in the gimp from black (0) to white (255). This made no difference in the display. I'm trying to determine whether the problem exists in the ASE file or the texture image file. Here is the ASE file:

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  
*3DSMAX_ASCIIEXPORT     200
*COMMENT "AsciiExport Version  2.00 - Mon Mar 29 16:37:12 2004"
*SCENE {
        *SCENE_FILENAME "1.max"
        *SCENE_FIRSTFRAME 0
        *SCENE_LASTFRAME 100
        *SCENE_FRAMESPEED 30
        *SCENE_TICKSPERFRAME 160
        *SCENE_BACKGROUND_STATIC 0.0000 0.0000  0.0000
        *SCENE_AMBIENT_STATIC 0.0000    0.0000  0.0000
}
*MATERIAL_LIST {
        *MATERIAL_COUNT 1
        *MATERIAL 0 {
                *MATERIAL_NAME "1 - Default"
                *MATERIAL_CLASS "Standard"
                *MATERIAL_AMBIENT 0.5882        0.5882  0.5882
                *MATERIAL_DIFFUSE 0.5882        0.5882  0.5882
                *MATERIAL_SPECULAR 0.9000       0.9000  0.9000
                *MATERIAL_SHINE 0.1000
                *MATERIAL_SHINESTRENGTH 0.0000
                *MATERIAL_TRANSPARENCY 0.5000
                *MATERIAL_WIRESIZE 1.0000
                *MATERIAL_SHADING Blinn
                *MATERIAL_XP_FALLOFF 0.0000
                *MATERIAL_SELFILLUM 0.0000
                *MATERIAL_FALLOFF In
                *MATERIAL_XP_TYPE Filter
                *MAP_DIFFUSE {
                        *MAP_NAME "Map #1"
                        *MAP_CLASS "Bitmap"
                        *MAP_SUBNO 1
                        *MAP_AMOUNT 1.0000
                        *BITMAP "./resources/textures/gradtex.png"
                        *MAP_TYPE Screen
                        *UVW_U_OFFSET 0.0000
                        *UVW_V_OFFSET 0.0000
                        *UVW_U_TILING 1.0000
                        *UVW_V_TILING 1.0000
                        *UVW_ANGLE 0.0000
                        *UVW_BLUR 1.0000
                        *UVW_BLUR_OFFSET 0.0000
                        *UVW_NOUSE_AMT 1.0000
                        *UVW_NOISE_SIZE 1.0000
                        *UVW_NOISE_LEVEL 1
                        *UVW_NOISE_PHASE 0.0000
                        *BITMAP_FILTER Pyramidal
                }
        }
}


I assume the only important parts at the top under materials so I've cut the rest of the file. Its just a textured cylinder and the texture appears correct, its just the transparency thats messed up.

17  Java Game APIs & Engines / Xith3D Forums / Re: Parabolic paths on: 2004-03-23 13:21:47
I had a similar problem so I created a Parabola class that could give me a point along a parabolic path at a given time. At the bottom you can see how I arranged that for display in Xith. Using that, I get a dotted-line parabola.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
    parabola = new Parabola(new Point3f(0,0,0), bOffset);
                                                                                                                                                             
    float[] verts = new float[303];
                                                                                                                                                             
    float totalFlightTime = parabola.getFlightTime();
    float increment = totalFlightTime / 100;
    float t = 0.0f;
    for(int i=0; i<verts.length; i+=3) {
      Point3f point = parabola.computePointAtT(t);
                                                                                                                                                             
      verts[i] = point.x;
      verts[i+1] = point.y;
      verts[i+2] = point.z;
      t += increment;
    }
                                                                                                                                                             
    lineAttribs.setLineWidth(lineWidth);
                                                                                                                                                             
    geom = new LineArray(verts.length / 3, LineArray.COORDINATES);
    geom.setCoordinates(0, verts);
    shape.setGeometry(geom);
                                                                                                                                                             
    appearance.setLineAttributes(lineAttribs);
    shape.setAppearance(appearance);


Also, I seem to recall having trouble using Point3f with some type of GeometryArray in the past. When I switched to floats it worked fine.
18  Java Game APIs & Engines / Xith3D Forums / Re: GIS app on: 2004-03-23 13:03:51
It would be nice if there were a toolkit specifically for GIS-related tasks in Xith. It would have, for example, a more robust and customizable Terrain class and maybe loaders for different vector and raster data.
19  Java Game APIs & Engines / Xith3D Forums / Re: GIS app on: 2004-03-23 13:01:18
When I say "features" I just meant you can fly down and look at the mountains, the roads, that sort of thing. All of the geographic features we have are just textured onto the terrain, which works fine for roads, oceans, etc. We do have "stuff" in the world, represented as 3d models, but they are all mobile and not fixed features. We don't have cities and things like that, although we can stick a VPF blob on there and say "thats where the city is". I'd like to have 3d features in the sense you are talking about and the paper you linked too looks like a good start.

As for rogertx's question, all you need to do to represent very large areas of terrain is to find a mapping into a smaller space. You have to do unit conversions from real world coordinates to 3d world coordinates. These are just static methods in a utility class that do the transform. How complicated that is depends on your requirements in terms of resolution, accuracy, precision, and the types of real world units you're working with.
20  Java Game APIs & Engines / Xith3D Forums / Re: GIS app on: 2004-03-23 02:35:19
Without going into too much detail, I am working on a GIS project in Xith for work. So far we can load terrain data and vector data for overlays like roads, oceans, etc and you can fly around and look at various features. I don't really see how this applies to Xith exactly, yes we're using it for GIS, but Xith can be used for anything. If you're looking for resources, be sure to see www.vterrain.org, there's a lot of good info there. If you have any questions, ask away...

Also, check NIMA (www.nima.gov) for access to government terrain data. They have VPF and DTED data available.
21  Java Game APIs & Engines / Xith3D Forums / Creating terrain overlays on: 2004-03-15 15:55:19
I have a terrain shape that I'd like to color based on overlays very much like in Simcity where you might display "fire protection coverage", "population density", or "high traffic areas". Does anyone know how this can be done in Xith? I initially thought to color vertices in the terrain shape geometry but I realized this would not work for culled terrain data because some polygons may be too big. I'm not familiar with the uses of the stencil buffer in this regard but it seems like a possibility. Any ideas, especially in terms of Xith's usefulness for this?
22  Java Game APIs & Engines / Xith3D Forums / Buffer Overflow Exception with Billboards on: 2004-03-12 13:53:11
Has anyone seen something like this before:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
Exception in thread "main" java.nio.BufferOverflowException
        at java.nio.Buffer.nextPutIndex(Buffer.java:419)
        at java.nio.DirectFloatBufferU.put(DirectFloatBufferU.java:232)
        at com.xith3d.scenegraph.GeomNioFloatData.setFloats(GeomNioFloatData.java:169)
        at com.xith3d.scenegraph.GeomContainer.setCoordinate(GeomContainer.java:564)
        at com.xith3d.scenegraph.Billboard.updateData(Billboard.java:196)
        at com.xith3d.scenegraph.GeomContainer.updateData(GeomContainer.java:625)
        at com.xith3d.scenegraph.Billboard.newFrame(Billboard.java:116)
        at com.xith3d.scenegraph.View.renderNode(View.java:1081)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:968)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.renderNode(View.java:1015)
        at com.xith3d.scenegraph.View.getRenderFrame(View.java:824)
        at com.xith3d.scenegraph.View.renderOnce(View.java:717)
        at com.xith3d.scenegraph.View.renderOnce(View.java:655)


I have about 30 models in my scene, each with a billboard thats used to label them. I think this is the 3rd or 4th time this error has occurred over the last 3 weeks. I'm not sure what causes it but it seems to be linked occur when I move models around in the scene. The rendering loop looks like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
/**
 * Starts the rendering loop.
 */

  public void start() {
    while(true) {
 
      // Handle layers, transforms, behavior, mouse, keyboard here
     // Picking interactions
     synchronized(pickParamsMutex) {
        if(mousePressed) {
          PickRenderResult[] results = pick();
                                                                                                                                                                        ... set the selected node ...                                                                                                                                                              
          mousePressed = false;
        }
      }
                                                                                                                                                               
    ... do camera stuff ...
 
    view.renderOnce();
    }
  }


Dragging a model with the mouse updates the models location transform which is the subtree that also contains the Billboard (offset from the model by some amount). Any ideas?
23  Java Game APIs & Engines / Xith3D Forums / Re: TerrainTest pick mod on: 2004-03-09 18:23:51
Quote
currently i setted TerrainShape.setPickable(true) but when i try to view.pick(canvas, mouseX, mouseY, 3, 3);
it returns array size as 0.

i'm trying to port my *very* old SimCity clone to use xith but no luck with this...

so you remember those old SimCity's? where you select a tool(lets pick residential zone) and user moves mouse to cell and clicks and cell changes to residential cell...

that's my goal but no luck with it...


I want to do something similar with a modified version of the Xith terrain. I think even if your setPickable() code returned a value, it would not do what you expect because the TerrainShape as a whole would be pickable, you'd only be able to know if the terrain was clicked or not. You would not know *where* the terrain was clicked.

One of the things I'm trying to figure out now is how to retrieve which triangle was clicked. I have a height map and I would like to display coordinates and elevation at the point under the mouse when the right mouse button is clicked and held. So far, it doesn't look like the  example code is going to work for this without a lot of modification.
24  Java Game APIs & Engines / Xith3D Forums / Re: Picking ASE models on: 2004-03-09 11:12:18
I did something similar with the "units" in my app, except I use a generic model class to store visibility traits and models that wraps the actual units so there is a separation between the model and view. A model management class handles the assignment of model branchgroups to the classes based on their type and the values in a configuration file.
25  Java Game APIs & Engines / Xith3D Forums / Re: Using multiple views on: 2004-02-25 05:05:15
Quote
I find interesting to point this problem.

How to display multiple views of the same scene? It becomes usual today in many online games to have a spectator view. So it could be interesting to have on the same screen a view from a player, a view from another player but in chase mode, etc...


Is anybody presently working towards this? I have a scene that I'd like to render a miniature overview of.  It would be great if I could render two separate views (one from ground level, one from above) and then use the above ground view as a UIOverlay. If the problem with multiple views was resolved would there be any additional problems rendering to canvas on a JPanel that was in turn being used as a UIOverlay?
26  Java Game APIs & Engines / Xith3D Forums / Fog? on: 2004-02-20 19:55:22
Does Linear or Exponential Fog work in Xith? I want to fog the terrain so I set it up like this:

LinearFog fog = new LinearFog();
fog.setColor(new Color3f(1.0f, 0.0f, 0.0f));
fog.setFrontDistance(16.7f);
fog.setBackDistance(23.0f);
fog.setInfluencingBounds(shape.getBounds());
addChild(fog);

The parent is a BranchGroup that also contains a Shape3D object of my terrain. The end result has no apparent effect on the display.

What I hope to accomplish is a blurring of terrain edges and mountains at a distance because now they arent very smooth.  

Does anyone have a working example of applying fog in a scene?
27  Java Game APIs & Engines / Xith3D Forums / Re: Color differentiation at a distance on: 2004-02-19 13:01:34
Sorry for the delay with following up on this. The problem appears to be with multitexturing. For our program we were originally multitexturing the terrain with overlays and have switched to a single texture approach with the old layers compiled onto a single texture. For whatever reason, this fixed the problem. Are you using multitexturing in your program that exhibits this problem, Bombadil?
28  Java Game APIs & Engines / Xith3D Forums / Color differentiation at a distance on: 2004-02-17 11:25:23
My app displays a large map with various objects some of which are transparent spheres. The camera can move freely in the world and look back over the entire world from high above. From this perspective, some translucent spheres at a certain distance from the camera loose their red color and turn white/lavender, while the spheres nearer the camera stay red. The color of the sphere has meaning in my program so I need the spheres to remain the color I assign them no matter what the distance. Does anyone know why the colors change or how to make them remain the assigned color? Here is how I created the sphere geometry and coloration:

1  
2  
3  
4  
5  
6  
...
    Appearance sAppearance = new Appearance();
    sAppearance.setColoringAttributes(new ColoringAttributes(new Color3f(1.0f, 0.0f, 0.0f), ColoringAttributes.NICEST));
    sAppearance.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.8f, TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA, true, true));
    Shape3D shape = new Shape3D(s.getGeometry(), sAppearance);
...


This shape is then added to the scenegraph and displays correctly except for its appearance when viewed from afar.
29  Java Game APIs & Engines / Xith3D Forums / Re: Text2D, Text3D in Xith3D? on: 2004-02-13 17:16:07
Getting billboarding to work in the program was a lot easier than I thought. Here's a simple code sample for people like me who thought it was hard to figure out:

1  
2  
3  
4  
5  
 Appearance billboardAppearance = new Appearance();
 billboardAppearance.setColoringAttributes(new ColoringAttributes(new Color3f(0.0f, 1.0f, 0.0f), ColoringAttributes.NICEST));
    Billboard billboard = new Billboard(Billboard.COORDINATES | Billboard.TEXTURE_COORDINATE_2, 500, 500);
    Shape3D billboardShape = new Shape3D(billboard, billboardAppearance);
    scaleGroup.addChild(billboardShape);


I haven't textured them yet but they work great.
30  Java Game APIs & Engines / Xith3D Forums / Re: Text2D, Text3D in Xith3D? on: 2004-02-04 13:11:18
I had considered what is recommended above (drawing textures with 2d and billboarding them) but the Billboard class isn't fully implemented because Behaviours aren't in place yet. So there are a number of components I will have to derive to make this work. If you have code, I'm sure we'd all appreciate having a look at it and possibly contributing to its improvement. Perhaps post a URL for download?
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (28 views)
2014-04-15 18:08:23

BurntPizza (25 views)
2014-04-15 03:46:01

UprightPath (40 views)
2014-04-14 17:39:50

UprightPath (22 views)
2014-04-14 17:35:47

Porlus (38 views)
2014-04-14 15:48:38

tom_mai78101 (62 views)
2014-04-10 04:04:31

BurntPizza (121 views)
2014-04-08 23:06:04

tom_mai78101 (221 views)
2014-04-05 13:34:39

trollwarrior1 (188 views)
2014-04-04 12:06:45

CJLetsGame (195 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!