Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: [1] 2 3 ... 102
1
Support / Loader.loadOBJ Problem
« on: October 31, 2017, 08:33:08 pm »
Code: [Select]
System.out.println("\n\n\nWarcraft.loadObject: "+fileName +" Is the mtl null? "+(mtlFile==null));
System.out.println("Is loadOBJ(fileName, mtlFile) null? "+(Loader.loadOBJ(fileName, mtlFile, .5f)==null));

Produces:
Quote
Warcraft.loadObject: buildings\castle_construction0.obj Is the mtl null? false
Exception in thread "main" java.lang.NullPointerException
        at java.util.Hashtable.put(Unknown Source)
        at com.threed.jpct.Loader.loadOBJ(Loader.java:819)
        at com.threed.jpct.Loader.loadOBJ(Loader.java:508)
        at Warcraft.loadObject(Warcraft.java:250)
        at Worker.moveTowardsDest(Character.java:393)
        at Warcraft.loop(Warcraft.java:320)
        at Warcraft.<init>(Warcraft.java:163)
        at Warcraft.main(Warcraft.java:1058)

I've opened the file in Blender and it loads just fine.

2
Support / Re: Fog Of War Transparency With Software
« on: October 27, 2017, 07:13:43 pm »
Is this too big a scale for a Warcraft level, in your opinion?

Quote
************
World bounds:
X: -1133.6974, 318.40582
Y: -279.86633, 0.25386608
Z: -925.57733, 135.38232
************

3
Support / Re: Fog Of War Transparency With Software
« on: October 27, 2017, 06:50:39 am »
I got it working by calling recreateTextureCoords(). Is that costly? It seems like it would be.

Oh, and how could I come as close as possible to an orthographic view (in order to reduce the displacement between the fog and the gound)? Field-of-view? And would that be by increasing or decreasing it?

4
Support / Re: Fog Of War Transparency With Software
« on: October 27, 2017, 06:07:48 am »

5
Support / Re: Fog Of War Transparency With Software
« on: October 24, 2017, 07:34:53 am »
That's weird. The video is no longer up (I just signed in from a different computer and can't see it). I wonder if Google took it down. Try again in a few hours, please. As soon as I wake up I'll check this out.

6
Support / Re: Fog Of War Transparency With Software
« on: October 23, 2017, 05:32:54 pm »
The planes are created with the Extended Primitives class. So are the ones in my test case.

7
Support / Re: Fog Of War Transparency With Software
« on: October 20, 2017, 09:42:10 pm »
The solid-color ones are semi-transparent (and where they belong).

8
Support / Re: Fog Of War Transparency With Software
« on: October 20, 2017, 07:07:41 pm »
I tested both the application logic (by replacing them with solid-color textures) and the same loading line (TextureManager.getInstance().addTexture("fog-left.png", new Texture("Assets"+File.separator+"fog-left.png", true))). Could it be relative to the number of polygons, or the sheer scale of the world? Maybe force-sorting the transparency list would fix it. Because number of polygons and size of the world are the only two different things between my test and the actual game.

9
Support / Re: Fog Of War Transparency With Software
« on: October 19, 2017, 08:30:59 pm »
I wrote a simple test and transparency worked. So then I wrote the following method, and all I get are "End of printOddTransparencies()" prints. So now I'm stumped.

Code: [Select]
     public void printOddTransparencies(World theWorld) {
for (int y = 0; y < planes[0].length; y++)
     for (int x = 0; x < planes.length; x++)
if (theWorld.containsObject(planes[x][y]) && planes[x][y].getTransparency() != 0)
     System.out.println("Odd transparency at ("+x+", "+y+"): "+planes[x][y].getTransparency());
System.out.println("End of printOddTransparencies()");
     }

10
Support / Re: Fog Of War Transparency With Software
« on: October 16, 2017, 10:21:38 pm »
They are set to 0.

12
Support / Re: Fog Of War Transparency With Software
« on: October 13, 2017, 10:19:38 pm »
No, those are the edges of the fog of war. The fog is black, naturally.

14
Support / Re: Fog Of War Transparency With Software
« on: October 12, 2017, 07:41:14 pm »
The textures are right. I set transparency to 0.

15
Support / Fog Of War Transparency With Software
« on: October 12, 2017, 03:02:14 am »
I''m writing a strategy game and can't seem to properly paint a transparent PNG on my fog (so that its edges are rounded). The logic for the texture placement is sound and has been tested. But all I get is solid black.

Code: [Select]
if (!TextureManager.getInstance().containsTexture("fog-top")) {
     TextureManager.getInstance().addTexture("fog-top", new Texture("Assets"+File.separator+"fog-top.png", true));
     TextureManager.getInstance().addTexture("fog-left", new Texture("Assets"+File.separator+"fog-left.png", true));
     TextureManager.getInstance().addTexture("fog-right", new Texture("Assets"+File.separator+"fog-right.png", true));
     TextureManager.getInstance().addTexture("fog-bottom", new Texture("Assets"+File.separator+"fog-bottom.png", true));
}

Pages: [1] 2 3 ... 102