Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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 / Java 3D / Re: Texture Mapping for Terrain on: 2004-09-21 20:12:18
I haven't been working on this for months; I got busy doing something else, totally unrelated.

I don't know why the colors are messed up. Like I said, I didn't do anything wierd, just straight painting, much like you posted in your code. Maybe a color depth problem (to few bits, so colors are getting mapped to other colors)? But I wouldn't expect that for the primary colors you're using. I honestly don't know. Sorry.

-Tab
2  Discussions / Miscellaneous Topics / Re: Analysis Paralisis - how do you cope? on: 2004-06-26 10:08:12
ahristov, (long post coming... sorry)

I generally agree with all the comments here. It sounds like I'm in much the same situation as you. Besides programming, I love the research I do before getting on with a new project. I love the research so much, I never stop doing it, in fact. I've never written a game before, but I've been programming for 15 years. Gaming is definitly a hobby for me. Here's what I did/do:

I found this forum and I read like mad for about 3 days straight. This gave me a broad base of information. Then I took break, let it sink in, and decided to write a 'game'. I say 'game' because I don't necessarilly think what I'm writing will be any fun, if I ever even finish it. I think of it as a technology test where I can try out things without sweating the details like a schedule or 'proper design docs' and such. The game I picked is is the classic balistics game where multiple players pick angle/power and try to shoot one another. I extended it to 3D, live action, on a network. I'm trying to play with these techs: 3D, sound, input, model building, networking (for games), and physics. To me, these areas seem to cover almost anything I'd like to write and I have almost no previous knowledge.

I started coding with very minimal initial goals, like generating a random terrain height map and displaying it with java3D (colored, no textures) (about a month of work). I then worked a little on input just so I could move around and gracefully exit my app. Then I started to build models using an editor (Blender) which took a bit of research and a learning curve (another month). Then I got my models into my app and displaying as I wanted. Then I started working on physics (using odejava) and getting my models to move around (another month). Then I worked on texturing. I just finished writing a particle engine. I haven't touched sound or networking yet, and I have to revisit input soon.

Basically, I focus on one particular aspect at a time and learn as much as I can about it while I'm writing it. I throw out a lot of code along the way, and sometimes have to make huge architectural changes to my app, but I set my initial expectations with all that in mind.

I also read these forums every day. I find they make good breakfast reading (I'm eating my cereal right now). On any given day, I might be focusing my reading on a particular area that I plan on working on in the next few days, but I read almost every new post in every topic anyway. I'm always finding little bits of insight into aspects I never would have thought about otherwise. I find that I'm slowing building a deeper understanding of the whole gaming thing, and not just about my 'game'.

I've also decided that I'll never know absolutlely everything about everything in these areas, but rather I understand enough to ask [hopefully] intelligent questions, make good guesses, know the issues, pros and cons, and understand what others write on the subject (that seems to be true of life in general). My 'game' is slowly evolving into an architecture and design I wouldn't have thought of in the beginning, but makes sense now.

I also take my time. Lots of it.

I don't know if any of that helps, but it works for me.

-Tab
3  Game Development / Newbie & Debugging Questions / Re: Compiling java to .exe's on: 2004-06-17 13:47:08
Redistribution of Java is perfectly legal, as long as you follow the rules.

If you read the license agreement, it directs you the README file located in the root directory of your JDK or JRE installation. That file contains information about redistribution. Sun defines "required" and "optional" files and lists the optional ones (all those not mentioned being required). There doesn't seem to be any requirement about how the files are packaged for redist (i.e., in your own setup.exe without Sun's installer).

In addition, in the JRE README, Sun even allows you to copy the server VM from the JDK and redist that with the JRE. That should please some people.

I imagine the only difficult part is actually building the installer to put all the files in the right places, but that can't be too hard for anyone ready to build an installer.

Just to be clear, I am not a lawyer, nor am I practicing to be one. Read the docs for yourself.

-Tab
4  Game Development / Game Mechanics / Re: [Odejava] native code - should we turn on debu on: 2004-06-08 14:13:34
As a developer, having access to the debug versions would be nice. Especially if there's a chance we can get debug output related to order of operations. I agree CVS is not the place for the binaries though.

If you put ODE binaries in the filesharing section, you need to make it VERY clear as to which versions of odejava they work, and you should probably do 'official' releases of odejava more often (at least as often as the binary updates) and put them in the filesharing area too. Since the binaries will be a seperate download, you don't want users scratching their heads trying to figure out which binary/java combo works. Make it stupid obvious.

-Tab
5  Java Game APIs & Engines / Java 3D / Camera interpolation on: 2004-05-28 21:32:38
This is a general 3D question, not specific to Java3D, altough that's what I'm using.

I'm trying to move my camera between two points in 3-space. There's also a change in orientation involved. Interpolating the position is a no brainer. I found that by using quaternions to represent the orientation, I can interpolate using "great circle interpolation" (I think this is also called SLERP?). It mostly works, but the interpolation seems to break down when interpolating between certain orientations. By breakdown, I mean the current camera orientation converges toward the target orientation, but never quite makes it, and ends up bouncing around some other intermediate orientation, never getting to the target orientation.

Is this a common problem with quaternions? Am I doing something wrong? Is there a better way to accomplish this?

Here's a chunk of code I'm using, which gets executed on each frame (*Rotation is a Quat4f, *Location is a Vector3f):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public void stepFrame() {
    transformGroup.getTransform(currentTransform);
    getTargetTransform(targetTransform);
    targetTransform.get(targetRotation, targetLocation);
    currentTransform.get(currentRotation, currentLocation);

    targetLocation.interpolate(currentLocation, 0.8f);
    targetRotation.interpolate(currentRotation, 0.8f);
    targetTransform.set(targetRotation, targetLocation, 1);

    transformGroup.setTransform(targetTransform);

}

6  Game Development / Game Mechanics / Re: [odejava] GeomTransform broken? on: 2004-05-28 19:37:23
No luck yet. I've run the demo and it works as expected. My code is doing exactly what yours is, in the same order. I'm still scratching my head.

I'll try to reduce my code to the bare minimum while reproducing my problem. I have no idea how long this will take because some real life is intruding on my play time. I'll update when I get something. Thanks.

-Tab
7  Game Development / Game Mechanics / Re: [ODEJava] QuickStep Solver on: 2004-05-27 01:04:23
I just finished reading ODE's May mailing list archive. I want QuickStep! Smiley

Consider this another vote (and a little poke). Any idea when we might see this in odejava?

-Tab
8  Game Development / Game Mechanics / Re: [odejava] why log4j? on: 2004-05-26 14:50:29
No, I hadn't seen that one. But now I have, and I even replied Smiley

As was discussed there, I don't think the built-in logging and log4j are interchangable. But the API's are very similar. And here, Will points out a couple of features that the built-in stuff doesn't have (since it violates platform independence, but frankly that's a stupid reason to keep it out in this case IMO).

I'll consider the issue dead. Except for the couple System.out.println's I found in Geom.java that should be replaced with logging statements, if not simply removed altogether. If you're going to do logging, then do logging.

-Tab
9  Java Game APIs & Engines / Tools Discussion / Re: Any one use log4j? on: 2004-05-26 14:46:02
For large projects (think EJB based apps for a national bank) we typically create a logger for each class file, as a static final member. The logger's name is the class's fully qualified class name. Since classes are kept pretty small (for good design reasons), we've never needed per-method loggers. In the log4j.conf file, we then specify which class/priority levels we want logged. It's pretty simple. I believe the java.util.logging stuff can do the same.

-Tab
10  Game Development / Game Mechanics / Re: [odejava] Geom.removeFromSpace on: 2004-05-26 14:34:26
Increasing memory didn't fix it  Sad

I've commented out the dSpaceAdd call and things work correctly. Are you sure adding a Geom to Space with a zero I is allowed in ODE? I'm not sure why it's even necessary after the dSpaceRemove call after reading the ODE docs.

-Tab

11  Game Development / Game Mechanics / Re: [odejava] GeomTransform broken? on: 2004-05-26 14:03:43
Changing the order as you suggested didn't help; same problem. However, I have discovered that my model isn't simply falling through the terrain, but is getting totally dislocated from reality:

1  
2  
location: (-1.0, 50.0, -1.0)
location: (NaN, NaN, NaN)


That's output from my app for each frame. Each line of output is before I call stepFast. The first line indicates my body's location as I set it before I run the sim. The second line shows the body's location after ODE gets done with it. And that's the last line of output. No additional frames are rendered and it seems the whole Java3D render loop is stuck (trying to render an object that is "nowhere"?).

When I revert to my previous code (i.e., no GeomTransform), I get normal output:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
location: (-1.0, 50.0, -1.0)
location: (-1.0, 49.720078, -1.0)
location: (-1.0, 49.613567, -1.0)
location: (-1.0, 49.488773, -1.0)
location: (-0.9878979, 49.206493, -1.0057374)
location: (-0.9750137, 49.111187, -1.0105658)
location: (-0.95794374, 49.023903, -1.0157655)
location: (-0.94674605, 48.94492, -1.0238384)
location: (-0.9331251, 48.95429, -1.0324804)
location: (-0.92429227, 48.981445, -1.0410043)
...


As you can see, the sim runs and the body can be seen to fall under gravity's influence until it collides with the terrain at about y=49.3, then it bounces a bit and life goes on.

I can't figure out what's wrong. I'm willing to try to build a test case, but that would be a horrendous task starting from my current code base. In the test you displayed in the other post, did you have gravity?

-Tab
12  Game Development / Game Mechanics / Re: [odejava] Geom.removeFromSpace on: 2004-05-26 12:33:16
I'll try to increase the mem, but I doubt it will help. I haven't changed my code, only updated and rebuilt odejava from cvs yesterday. I'll let you know...

-Tab
13  Game Development / Game Mechanics / Re: [odejava] GeomTransform broken? on: 2004-05-26 12:31:16
Yes I did see the post you refered to, but had forgotten about it :-/

I'll try changing the order of the statements. Thanks for the tip.

-Tab
14  Game Development / Game Mechanics / Re: [odejava] why log4j? on: 2004-05-26 12:29:13
Let me just say up front that I'm not making an argument to change the logging in odejava. I can't argue with log4j's extra features, though I've never used them.

But..., grabbing the log4j.jar file is just the beginning.

I prefer not to install libraries using Java's extension mechanism for the simple reason that it's too easy to forget they're not a standard part of the Java dist. I have my own lib directory I install this stuff into and that forces me to deal with the libs in my build.xml and startup scripts. That, in turn, better documents my app's dependencies. I've been bitten too many times to count by "publishing" an application only to have a user install it and not be able to run it because they don't have some component I've been taking for granted. Not only in Java, but Perl, C, etc. I prefer to force myself not to take third party libs for granted.

And even if I wasn't crazy as described in the previous paragraph, I'd have to remember to sign the log4j.jar and include it in the webstart config for my app since the average user will not have downloaded and installed, let alone even heard about, the extra library. Using my technique above doesn't change this, except that my ant build script now explicitly specifies the dependencies, and won't even compile my project without them, so I have a place to go to find them.

Of course, I also use Java3D, which is installed in Java's ext dir by default, which annoys me. That's another can of worms I won't get into now.

And of course all of this is getting dangerously close to the personal philosophies most programmers develop over time and like to defend to their deaths. I'm not trying to convince anyone my way's better. Take it or leave it.

-Tab
15  Java Game APIs & Engines / Tools Discussion / Re: GameSpace - Any comments ? on: 2004-05-26 01:51:26
Chman, yes my login name does mean something (it's a secret Wink ). Most people are taken aback with it, but it rolls off my tounge easily enough.

-Tab
16  Game Development / Game Mechanics / [odejava] Geom.removeFromSpace on: 2004-05-26 01:36:18
Will/Jani,

I'm getting an exception from odejava.dll when trying to remove a Geom from a space:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x5E16D99
Function=dSpaceAdd+0x9
Library=C:\wip\lib\odejava.dll

Current Java thread:
        at org.odejava.ode.OdeJNI.dSpaceAdd(Native Method)
        at org.odejava.ode.Ode.dSpaceAdd(Ode.java:441)
        at org.odejava.Geom.removeFromSpace(Geom.java:357)
        at org.odejava.Space.remove(Space.java:155)
        at org.bennedum.tank.Universe.remove(Universe.java:214)
        at org.bennedum.tank.ProjectileManager.stop(ProjectileManager.java:110)
        at org.bennedum.tank.ProjectileManager.stepFrame(ProjectileManager.java:53)
        at org.bennedum.tank.Universe.stepFrame(Universe.java:283)
        at org.bennedum.tank.Universe$FrameBehavior.processStimulus(Universe.java:346)
        at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172)
        - locked <0x11a343f0> (a javax.media.j3d.BehaviorRetained)
        - locked <0x11a343f0> (a javax.media.j3d.BehaviorRetained)
        at javax.media.j3d.J3dThread.run(J3dThread.java:250)


I didn't include all the other garbage output, but I can if anyone thinks it's useful.

The code from Geom.java is:

1  
2  
3  
4  
5  
6  
7  
8  
      protected void removeFromSpace () {
            assert spaceId != Space.SPACEID_ZERO: "This geom is already not in any Space";
           
            Ode.dSpaceRemove(spaceId, geomId);
            spaceId = Space.SPACEID_ZERO;
            Ode.dSpaceAdd(spaceId, geomId);

      }


Is the SPACEID_ZERO defined by ODE or is it something peculiar to odejava? If it's specific to odejava, then I don't think you should be trying to add a geom to that space in ODE. But maybe I'm wrong?

I seem to recall that I had this problem once before, but I can't figure out what I did.

-Tab
17  Game Development / Game Mechanics / [odejava] GeomTransform broken? on: 2004-05-26 00:10:45
I'm trying to use one aspect of the new multi-geom support. Specifically, I'm trying to add a single Geom to a body where the Geom's center does not coincide with the body's reference point. I started with code like this:

1  
chassisBody.addGeom(new GeomBox(CHASSIS_WIDTH, CHASSIS_HEIGHT, CHASSIS_DEPTH));


And that works as expected. I then changed it to offset the geom relative to the body:

1  
2  
3  
4  
5  
g = new GeomBox(CHASSIS_WIDTH, CHASSIS_HEIGHT, CHASSIS_DEPTH);
g.setPosition(V_CHASSIS_OFFSET);
gt = new GeomTransform("chassisTransform");
gt.setEncapsulatedGeom(g);
chassisBody.addGeom(gt);


But when I run the sim, the chassis body immediately disappears from view. I haven't tried to track it down, but maybe it's falling through the Trimesh terrain. This is also the behavior when V_CHASSIS_OFFSET is a zero vector (0, 0, 0), which I would expect to behave exactly as if there was no GeomTransform, just like the first code block.

Am I doing something wrong? I believe I'm doing things as the ODE docs say, but maybe I missed something.

-Tab
18  Game Development / Game Mechanics / Re: [odejava] why log4j? on: 2004-05-25 14:35:02
The built in Java logging can also be configured from a file and is also hierarchical. The API is very similar. Log4j's config file is xml, Java's is a properties file. As a result, Java's configs tend to be more compact.

I've used both systems professionally and made the decision that for all my own projects, I'll use the builtin stuff. The differences are so small for me, the fact that I have to have an extra jar file for log4j is a bother.

I'm not trying to start a huge debate here. You're free to use log4j on your own projects. My previous post probably came across as a little testy. It happened after a particlarly frustrating hour (early in the morning) of trying to get odejava to behave in a sensible manner (and failing), then getting the latest version from cvs (hoping maybe I was just hitting some bugs that had been fixed) and trying to build it, only to have the compile fail because I didn't have log4j.

-Tab
19  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-25 14:14:56
Nothing is ever cheap these days  Smiley

I didn't notice that kind of hit for my app, but it probably has to do with the fact my frame rate is already low (~10% of 30 FPS is only 3 FPS). I noticed a slightly bigger hit using the J3D overlay, which everyone seems to say works the best. Maybe it works better for higher FPS apps. I'll stick with the simpler, standard paint interface for now. Maybe it will get accelerated in 1.5b2? One can only hope.

But now that you bring it up, I'm curious why people care so much about frame rate when it's above 30 FPS? I can understand using it for a performance indicator, but high frame rates (above movie or video frame rates of 24/30 FPS) don't do anything for the visual experience IMHO. I'm not trying to start a war here, I'm genually curious why people get so worked up about it?

-Tab
20  Game Development / Game Mechanics / [odejava] why log4j? on: 2004-05-25 01:33:54
Will, I assume you'll be reading this.

I seem to recall a post (but can't locate it now) about odejava using log4j. I never said anything then, but I am now. Why not just use the built in logging? It's yet another library I need to download and install now.

-Tab
21  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-24 20:37:51
The HUD is simply Java2D stuff on top of the Canvas3D. Specifically, I subclassed Canvas3D and implemented the postRender method:

1  
2  
3  
4  
5  
6  
public void postRender() {
    J3DGraphics2D g2 = getGraphics2D();
    paintMap(g2);
    paintText(g2);
    g2.flush(true);
}


The two paint methods are completely my own and look a lot like a standard AWT/Swing paint method. The J3DGraphics class is a subclass of Graphics2D, which of course is a subclass of Graphics. It was really quite simple to do.

Previous to this, I had used the J3D overlay system, but it has problems. Most notibly for me, the lack of precise pixel control (since it uses textures on 3D surfaces), and the performance hit (it drops the framerate by 30%). I looked into the newdawn HUD stuff to, but I never tried it, believing that there had to be a better way. Then I actually looked at the Java3D API docs and found the magical postRender and getGraphics2D methods. The Canvas3D technique works quite well for me.

-Tab
22  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-24 17:29:10
As requested:



I tried to position the player to get a decent panoramic view showing a few different texture types. The player is sitting on a mix of snow and rock and you can see dirt, grass, and sand below. The transitions between the areas and the close up detail were the effects I were going for. The wall in the background is also textured using the same base texture. You can see some artifacts there, but they go away when I turn on fog (which is off for testing purposes).

The terrain is randomly generated and the textures are built based on elevations and slopes of the resulting height map. I'd like to eventually tweak the generation algorthm to get more dramatic elevation differences rather than the "rolling hills" I have now.

To give a sense of scale, the player is about 800 meters from the far corner of the wall (near the center of the image) as can be seen in the HUD map, and elevation difference between where the player is and bottom of the sand pit is around 60 meters. The entire terrain is 1km on a side, with a maximum elevation difference of 100 meters.

The frame rate displayed in the upper right isn't that great because a) I haven't fully optimized the code and it's lags once in a while, and b) I'm only running on an nForce board with the onboard gfx, which is a GF2MX with 32 MB, and a 1.4MHz Athlon. Normal framerate for me (when it's not laggy) is about 29 FPS. The texturing didn't effect the FPS at all when I turned it on. I had been using simple material colors with shading previously.

-Tab
23  Java Game APIs & Engines / Tools Discussion / Re: GameSpace - Any comments ? on: 2004-05-24 14:54:10
Yes, .x files are DirectX files. They are a simple text format and not, as the name implies, strictly tied to MS or DirectX (there's nothing in them that requires, or even hints, at the use of DirectX).

Last week, I became needful for a modeller app since I'm at that point in my project. I wanted something "free" since money is really tight.

I played with Milkshape a bit. The interface is easy to use, but the need to switch between different tools all the time really slowed me down (it's hard to explain). Also, the fact that it's a limited time demo and requires payment and reg after 30 days doesn't really make it "free".

I downloaded and tried GameSpaceLight, and I have to agree with Kev about the interface. I couldn't figure anything out. The tutorials are even hard to follow since all functions are accessed through little icon buttons around the edges of the main window, so when the tutorial says "select such and such", it has a little picture of the icon to click, and you have to hunt around all the toolbars and find an icon that matches. It got tedious very quickly. The features of the app sound great. If you can get past the interface, it sounds like a cool tool. Alas, I couldn't manage it.

I then tried Blender, even after hearing all the bad things about it's interface and unfriendlyness to new users. I was pleasently surprised. In fact, it's become my main modeling tool now. It took about 2 days of tuoritals to get used to the interface, but it makes sense to me now and I'm already highly productive. I can now understand why they made the interface design choices they did. It's all a matter of opinion.

I guess this turned into a mini-review of a few modelers. Sorry about that. I hope you find something useful.

-Tab
24  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-21 15:40:59
Eureka!

I've got my terrain textured the way I want. And I actually understand how it's done. I'd like to thank all those that helped.

Herkules, I answered my last question myself after I reread one of your previous posts and took a look at the detail map you're using in FG. For all those reading along also looking for the answer, the detail map is totally mapped (0..1) to each 3D "quad", which is usually composed of 2 triangles. So in my case, each quad is 4 Java3D units on a side and the detail map is 256x256. So for the base level mipmap, that's 64 texels per Java3D unit (each texel is about 2cm square resolution), which seems to be plenty of detail for my project.

Thanks all!

-Tab
25  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-19 21:21:38
I think I have a handle on this now. The trick, in my case, will be generating the base texture since my terrain is randomly generated at run time. I noticed in FG that the textures and height map are all static, which won't work for me.

I'm working on some code to test some ideas for generating the base texture now. It will probably take a few days to get it working the way I want.

Herkules, concerning the detail map you use in FG, how do the dimensions of that image relate to world scale? In other words, how many linear texels to a unit length in 3-space are you using? I'm just wondering how detailed the detail map should be.

Thanks for the help!

-Tab
26  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-19 15:14:13
I think I understand now! The high level description is just what I needed. As I expected, it's not too difficult, I just couldn't get the pieces to line up in my head. I appreciate the help.

Just for a minor point of clarification, I assume the tiling you're speaking of relates to breaking up the terrain into individual Shape3D's to allow Java3D to better optimize the rendering? That's what I'm doing in my own code, but I haven't been using the term 'tile', so I just want to make sure I'm not missing some other essential point.

-Tab
27  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-18 21:51:28
Ok, I looked at the terrain stuff if FG, but I admit I don't readily understand what's going on (reading someone else's code is always tough). I think I need a higher level explanation of what's happening with the detail map and then maybe the code will make more sense. Is Herkules listening?

-Tab
28  Java Game APIs & Engines / Java 3D / Re: Texture Mapping for Terrain on: 2004-05-17 14:43:42
Something you said in the last paragraph seems to have jarred some realization in my brain. Just to be sure, when you refer to a texel, you're referring to a pixel in a texture bitmap, correct?

That would explain some of the other posts I've read. Some people refer to having a single terrain texture some 2 or 4 times the width and depth of their height map, meaning 4 or 16 texels map to a single square in the height map and those texels get "spread out" over the rendered quad (or 2 triangles). The texture map used is built using Java2D techniques and whatever algorthm I want as the scene is setup. It's static during rendering.

Does that make sense? That's my distillation of a few posts I've read that didn't seem to spell the details out. It makes more sense now.

On to the detail map... I'm not clear how that works in practice. I understand the theory, but how does it get implemented? It sounds like a texture to each triangle problem again. Is this a form of "multi-texturing"? And when you say the detail map "modulates" the underlying texture, are you taliking about the rendering properties like BLEND and MODULATE? Can a detail map be used to modulate a simple color shaded triangle (i.e., a color assigned to each vertex and the engine interpolates the colors accross the face of the shape)?

I once took a look at FG, but I wasn't looking for texturing techniques at the time. I'll have another look.

-Tab
29  Java Game APIs & Engines / Java 3D / Texture Mapping for Terrain on: 2004-05-17 02:46:49
I've read a number of previous posts on texturing terrain and I still can't get my head around certain aspects. Here's what I want to do:

I have terrain constructed of triangle meshes, based on a height map. For any given triangle in the mesh, I want to assign a texture based on a combination of the elevations of each vertex and the "slope" of the triangle. That is, if the triangle has a shallow or flat "slope", I'd assign either a grass texture for a low elevation triangle, or a snow texture for a high altitude triangle. If a triangle's slope is very steep, I'd assign a rock texture. In between slopes might get dirt, sand, or other interesting textires. Get the idea?

I can certainly do what I propose, but I expect what I'll get won't make me happy. I expect I'll get hard edges on the triangles when the textures assigned to two adjacent triangles are different. I'd like a smooth transition between the textures. How is that done?

And when people refer to "detail" textures on base textures, and splatting, what do they mean?

If it makes any difference, I'm using Java3D.

-Tab
30  Game Development / Game Mechanics / Positioning jointed bodies on: 2004-04-29 23:44:16
I've got 5 bodies similar to the car in the CarTerrain demo: 1 main body (the chassis) and 4 'wheel' bodies, all connected with JointHinge2's. When I created the bodies and joints, the chassis body was at the origin, so I offset the wheels and joints to get them in the correct positions relative to the chassis.

Now, I want to 'pick up' the chassis and place it at a certain position and orientation before running the simulation. How can I do this [easily]?

If I position the chassis body and start the simulation, ode sees this as a huge error in the joints between the chassis and wheels and corrects by moving all the bodies around. And of course, the chassis is no longer where I wanted it anymore.

Is there any way to position/orient a set of bodies as a unit? I don't want to have to position/orient each body using a bunch of transforms, although I could, I suppose. Is there an easier way?

-Tab
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.

atombrot (20 views)
2014-08-19 09:29:53

Tekkerue (21 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (55 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (28 views)
2014-08-08 02:01:56

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (65 views)
2014-08-03 02:57:17
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!