Jump to content
  • entries
    707
  • comments
    1173
  • views
    436294

Untitled

Sign in to follow this  
Programmer16

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 SubSet

SetTexture(0)
DisableLighting()
SetFillMode(WireFrame)
DrawEach SubSet
EnableLighting()
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:

Parameters
pFirstPosition
[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 Values
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.

Remarks
Requirements
Header: 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!

Sign in to follow this  


3 Comments


Recommended Comments

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.

Share this comment


Link to comment
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.

Share this comment


Link to comment
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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!