• entries
707
1173
• views
436294

# Untitled

139 views

First off, I got a temporary gallery set up thanks to Evil Steve. You can check it out here. I'll still be posting screenshots in my entries though. Edit: Yea, here's the gallery page: Project Asrion Gallery

DragonForge Technology

I made some more progress today. Engine wise I cleaned up a large problem with my pool class. I was checking to see if the resource already existed, if so I would return it; otherwise I would create a new resource. This is, of course, a really good idea... if I was adding the new resource to the list. I thought it was pretty odd when my terrain system was taking over half a minute to load (new terrain system, I'll explain in a moment.) Turns out, it was loading 100 copies of floor4.x and floor4.png.

So, I dropped the heightmap system. I don't really like heightmaps, but that might stem from the fact that I suck horribly at using them. Anyway, the new map splits the terrain into tiles, which are models. So far it's working pretty good and runs fast enough, so I'm pretty sure I'm going to be sticking with it. Here's a screeny for you:

It's running slow in the screenshot because the meshes are being rendered like so (just so I could get the black outline. Without it, the shapes blend together since I haven't added lighting yet):
SetMaterial()SetTexture()DrawEach SubSetSetTexture(0)DisableLighting()SetFillMode(WireFrame)DrawEach SubSetEnableLighting()SetFillMode(Solid)

Without the second section I get about 400-450fps.

Now, onto a question: Is there any way to tell how tall an object is after it's been loaded (using D3DXLoadMeshFromX() and ID3DXMesh)? I'm going to allow for layers (as you can see from screenshot), but I need to know how tall the object is. I was thinking that maybe I could do it somehow using D3DXComputeBoundingBox(), but the documentation is kind of lacking in documentation for it:
ParameterspFirstPosition[in] Pointer to the first position.NumVertices[in] Number of vertices.dwStride[in] Count or number of bytes between vertices.pMin[out] Pointer to a D3DXVECTOR3 structure, describing the returned lower-left corner of the bounding box. See Remarks.pMax[out] Pointer to a D3DXVECTOR3 structure, describing the returned upper-right corner of the bounding box. See Remarks.Return ValuesIf the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.RemarksRequirementsHeader: Declared in D3dx9mesh.h.

Yea, I don't see any remarks. Mostly my problem is what are pMin and pMax? I know lower-left and upper-right, but there are more than one of each on a box. Here's a diagram:
    *--------*4   /|       /|  / |      / | *--+-----*3 | | 2*-----+--* | /      | / |/       |/1*--------*

Would pMin be 1 or 2? And would pMax be 3 or 4?

Any help would be appreciated!

Does it matter? 1 and 2 are at the same height, and 3 and 4 are at the same height. The height of the object is pmax.z - pmin.z; or pmax.y - pmin.y, depending on what coordinate system you are using.

Quote:
 Original post by Deyja Does it matter? 1 and 2 are at the same height, and 3 and 4 are at the same height. The height of the object is pmax.z - pmin.z; or pmax.y - pmin.y, depending on what coordinate system you are using.

lol, you're right. I was thinking more along the lines of it could be 1 and 4, or 2 and 3, but that would be retarded.

Well, it has to be one of those two pairs to get all the dimensions. But, that's all you care about : The dimensions. They are going to be the same no matter which pair it is.

## Create an account

Register a new account