Quote: "Happy Holidays to you too!"
Thanx
Sid Sinister Wrote:
Quote: "Wow really?"
(Which if is in response to my...
Quote: "I would say nothing if its anything like I'm finding is the case with Making Objects from Memblock.
"
)
I may be wrong - and I say this because I'm currently rewriting Lost In thought's Frustrum Code - but in DarkGDK - (Trying to make use of the difference between Object Hide, Hide Limb, and Exclude Object - (It's an optimization thing I'm doing so less looping occurs of the situation is correct)) anyway - There is reference to Matrix in there - and I KNOW it has nothing to do with DBPro "Matrix" stuff... Its instead 3D-MATH Matrix Stuff, along the lines of Vectors, and the 3d Math routines.
Hope this gets you pointed in the right direction.
Quote: "Whats the advantage of making a matrix from a memblock then?"
I dunno - but I know I can do all the stuff that you would do to a matrix with a MEMBLOCK MESH and making an actual object. Then as an actual object you can do whatever you want - so I think making a MESH and then an object and using VERTEX commands - using limbs etc - over all is more complicated but I think more powerful.
Quote: "Or is it making a matrix from a heightmap without using AT?"
You might say that. One guy in that thread you posted above said DBPRO Matrix is probably beginner's safe way to do some of the stuff you can do with 3d things - fairly easy. I think it was countered as a DBClassic thing left over as well.
NOT how I'd make a terrain knowing what I know now. That said, I still don't know the best way. I'm trying though!
Sid Sinister Wrote:
Quote: "Wow really?"
(Which if is in response to my...
Quote: "I was recently briefed on the steps to make an object from memory - and is was like messing with bitmap files for something - a header - some stuff to describe the mesh - then a bunch of vertex data in a specific format. I filled it - set it how I thought I wanted - made mesh from memblock - > object from mesh - whella - a Dark Basic Object! (Which I can save as a DBO I think! )"
Yeah - I lost the link - but I saved the steps from Rain Man who posted them:
My knowledge of how to do this is a bit limited, but I'll share with you what I know. This is how you make an FVF 338 memblock mesh. I'm sorry if this is a bit pedestrian, but I don't want to make any assumptions about what anyone who reads this knows.
1. Decide how many tiles you want your mesh to be. When I tried making a mesh larger than 100 x 100, I got some sort of memory error message. I don't know if my system doesn't have enough memory or if there is some limitation, or what. I just use multiple meshes if I need more than 100 x 100 tiles.
2. Determine the number of tiles by multiplying the number of tiles in the X dimension by the number of tiles in the Z dimension.
3. Determine the number of polys by multiplying the number of tiles by 2.
4. Determine the number of vertices by multiplying the number of polys by 3.
5. Determine the memblock size by multiplying the number of vertices by 36 and then adding 12 for header information.
6. Make a memblock of the size determined in step 5.
7. Write the header info as shown:
write memblock dword MemBlockNumber, 0, 338
write memblock dword MemBlockNumber, 4, 36
write memblock dword MemBlockNumber, 8, Number of Vertices
338 is the Flexible Vertex Format of the mesh we're making. 36 is the number of bytes per vertex (more on that later). Number of vertices was determined in step 4.
8. Establish a memory variable for the current memblock byte (MemoryPosition) and initialize the value to 12 - the first byte after the header info.
9. Do a FOR/NEXT loop which will write the following information for each vertex:
write memblock float MemBlockNumber, MemoryPosition, X Position
write memblock float MemBlockNumber, MemoryPosition, Y Position
write memblock float MemBlockNumber, MemoryPosition, Z Position
write memblock float MemBlockNumber, MemoryPosition, X Normal
write memblock float MemBlockNumber, MemoryPosition, Y Normal
write memblock float MemBlockNumber, MemoryPosition, Z Normal
write memblock dword MemBlockNumber, MemoryPosition, Grid Color
write memblock float MemBlockNumber, MemoryPosition, U Coordinate
write memblock float MemBlockNumber, MemoryPosition, V Coordinate
IMPORTANT NOTE: Increment the MemoryPosition variable by 4 after each value is written to the memblock.
The number of iterations of the loop is from 1 to the number of vertices.
The number 36 that has been used before comes from the 9 pieces of information listed times the 4 bytes that each float or dword needs.
10. Make a mesh from the memblock
MAKE MESH FROM MEMBLOCK MeshNumber, MemBlockNumber
11. Make an object from the mesh
MAKE OBJECT FROM MESH MeshNumber, ObjectNumber
Now, like you, I don't know the data layouts for the various FVF formats. But there have been times when I needed FVF 530 meshes which hold two sets of UV data. This is what I do for that:
1. Make an FVF 338 mesh as described above.
2. Convert the mesh to FVF 530:
CONVERT OBJECT FVF ObjectNumber, 530
3. Lock the vertex data.
4. Do a FOR/NEXT loop with the following command:
SET VERTEXDATA UV VertexNumber, TextureStage, U, V
The number of iterations is, once again, the number of vertices.
5. Unlock the vertex data.
Now, getting a second set of UV coordinates may not be what you need. My point is that I got that second set of UV coordinates without knowing the structure of the data for an FVF 530 mesh.
I hope this helps you out.
Quote: "I think I'm doing things a little scattered compared to the way your doing yours."
Order? I think I'm all over the place also.
Quote: "It's not exactly in order lol. "
Mine Either - I mean - is there a right way and a wrong way? Probably - but if at the end of the day it all works - BAH
Scattered is fine - Providing Each "Technique" or "Piece" your working on you make as modular as possible - so you can first make your legos building blocks - and then try your hand at building stuff with them
Quote: "What step are you in?"
Um. Well - I moved from Dark Basic to DarkGDK awhile ago as my primary weapon for Vertex Destruction. (I love that phrase I made up) And the first thing I did was write some stuff to sort of Wrap things into classes. Not just for the sake of doing it - but so that I could sorta make things work together - and I was careful to do it in a way wher just calling NATIVE DarkGDK commands outside of my classes would still be just fine.
That Said - I setup a file based database of SkyBoxes, so I can whip em open at will to a given scene - like a slide projector, I made sure I could do timer based stuff and wrapped some of those commonly needed things into a class.
I got frustrated with Advanced Terrain - and using Objects exported from terrain generators - and started just trying to get that mesh from memblock stuff going - and I did it!

Look at my web site - (link in my sig) in the gallery - there is a first shot of an Island in Hawaii - made from satelite information from the USGS - using my home brew mesh/ Terrain stuff.
I'm currently working out the Frustrum Culling stuff - and how to do Multi-texturing - Already figured out the Shader stuff - enough where I can use Green Gandalfs Terrain Shader but - it has its problems too - not his code - just the choice to commit to a shader in general. Depends on the look you're after - and you need to take into account Shader GPU Processing Time Versus CPU pipeline processing - and frankly - MY PC isn't a rocket - and Shaders - though work - just tank the FPS in half. I Never get 300fps like people here. If I have 70FPS - with just a CUBE - full screen - I'm happy. The good part of all this - is that if/when I get a working system I'm happy with here... it should SCREAM on everyone else's Machine!
Ok - I'm off for a bit - running out of coding time! (gotta work tomorrow)