Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ROAM and Height mapping  (Read 1585 times)
0 Members and 1 Guest are viewing this topic.
Offline A.H

Senior Newbie




Shouldn't Duke be a duck? It just makes sense.


« Posted 2004-12-01 23:42:42 »

Can anyone please direct me to a pure Java3D ROAM and/or height mapping example?

Many thanks.
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #1 - Posted 2004-12-02 08:19:59 »

IIRC, j3d.org has a ROAM implmentation. For a simpler heightmap, lookup my DRTS-project on sourceforge.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline A.H

Senior Newbie




Shouldn't Duke be a duck? It just makes sense.


« Reply #2 - Posted 2004-12-07 23:42:38 »

Ok Herkules, I decompiled SimpleHeighmap.class from your DRTS project.(Hope thats ok)

I understand everything until i got to this part

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
private static Raster getHeightRaster(Image image, int i)
{
        int j = image.getWidth(null);
        int k = image.getHeight(null);
        int l = j / i;
        int i1 = k / i;
        BufferedImage bufferedimage = new BufferedImage(l, i1, 10);
        bufferedimage.createGraphics().drawImage(image, 0, 0, l, i1, null);
        return bufferedimage.getData();
}


I searched around the Java Docs and couldn't find the method for this

1  
bufferedimage.createGraphics().drawImage(image, 0, 0, l, i1, null);


I know your drawing the image and then retrieving the Raster from the bufferedimage but can you explain the variables that

drawImage(image, 0, 0, l, i1, null);

takes?

Also what is the variable i, and why is j and k, the width and height being divided by it?(See code)

1  
2  
int l = j / i;
int i1 = k / i;


Another question, how would you go about creating a the terrain from the info you get from the Raster? Would you input the height info and stuff into a QuadArray?

Thanks.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #3 - Posted 2004-12-08 04:00:34 »

You don't have to decompile since you can download the sourcecode from CVS.

For now, I cannot explain in detail whats going on (and I personally haven't written that code).

Basically the heigthmap data is split into tiles, and for the tiles geometry is created. IIRC its a TriangleStrip.

In the game, view range and fog are adjusted to the size of the tiles, so that most of them are culled away.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Mike Jacobs

Junior Member





« Reply #4 - Posted 2004-12-08 11:48:29 »

This article covers the basics of height maps and terrains: (JDJ Sept 2004) http://sys-con.com/story/?storyid=46231&DE=1.  It does not cover texture mapping or tesselation like ROAM.  There is another article that includes creation of terrain from external files including photos with texture mapping here: (JDJ June 2004) http://www.sys-con.com/story/?storyid=45087&DE=1.  Both include documented source.

Hope this helps.

Mike

Special Effects for Java 3D games: http://www.indietechnologies.com
Offline A.H

Senior Newbie




Shouldn't Duke be a duck? It just makes sense.


« Reply #5 - Posted 2004-12-08 20:58:20 »

Thanks Mike, Herkules, the info you gave me was really useful. I'll post any questions when i run into some problems.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (9 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (27 views)
2014-08-22 19:31:30

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

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

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

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

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

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

BurntPizza (47 views)
2014-08-09 21:09:32
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!