Posted: 4th Jan 2004 3:07
Hope you like it. Special thanks to TheDarthster for helping me throughout the process of creating this (and explaining what memblock mesh format make memblock from mesh uses).

This library will give you direct access to your objects vertex data.
It does this by making a mesh, then memblock from the mesh, then editing
the mesh data in the Memblock.

The Library Contains the Following Functions
PositionVertex(Object Number,Vertex Number,X Position,Y Position,Z Position)
-Positions Vertex at Specified Coordinate
SetVertexNormals(Object Number,Vertex Number,X Normal,Y Normal,Z Normal)
-Sets the Vertices Current Normals
SetVertexUV(Object Number,Vertex Number,U Coordinate,Y Coordinate)
-Sets the Vertices Current UV Texture Coordinates
VertexPositionX(Object Number,Vertex Number)
-Returns the Vertices X Position
VertexPositionY(Object Number,Vertex Number)
-Returns the Vertices Y Position
VertexPositionZ(Object Number,Vertex Number)
-Returns the Vertices Z Position
VertexNormalX(Object Number,Vertex Number)
-Returns the Vertices X Normal
VertexNormalY(Object Number,Vertex Number)
-Returns the Vertices Y Normal
VertexNormalZ(Object Number,Vertex Number)
-Returns the Vertices Z Normal
VertexU(Object Number,Vertex Number)
-Returns the Vertices Current U Texture Coordinate
VertexV(Object Number,Vertex Number)
-Returns the Vertices Current V Texture Coordinate
Posted: 4th Jan 2004 3:12
Did you just directly run the source code, or did you try to use the functions? I'll test it out myself in a bit (after I submit it to the code base).

Cheers,
Preston
Posted: 4th Jan 2004 3:19
Thats the problem. It isnt an example, its just a bunch of functions to use in your programs. Either way, I tried running it in DBC, got a severe exception error when it tried to make the new object using the PositionVertex command. So, I'm guessing that the functions dont work with DBC. Oh well, at least it'll tide us over until U6 arrives, and we get official direct vertex manipulation commands

Cheers,
Preston
Posted: 4th Jan 2004 3:52
DBC's mesh memblocks are structured completely differently than DBP's. they use a complicated index buffer format rather than DBP's face list.
Posted: 4th Jan 2004 4:00
DBC's mesh memblocks are structured completely differently than DBP's. they use a complicated index buffer format rather than DBP's face list.


Well then, chances are I wont be porting this to DBC after all...oh well, thanks for telling me that DrakeX.

Cheers,
Preston
Posted: 4th Jan 2004 19:17
nice one mate!
Posted: 4th Jan 2004 21:13
I just ran the code that you gave me (source) in DBC & on line 112 'Program Ran Into Function Declaration'.


Thats the problem. It isnt an example, its just a bunch of functions to use in your programs


Posted: 6th Jan 2004 9:27
Hey Preston,
Could you post a small bit of code using this library on a cube or something.
I'm thinking you can use this to do live manipulations on objects, but maybe I'm digging to deep.
Anyway please help me understand

Thanks
Posted: 6th Jan 2004 10:51
Are the positions relative to the object's origin, or the world?
Posted: 7th Jan 2004 0:45
@burrbittyburr: I've included a small demo in the source box. This shows that the functions work, but they are flawed none the less. But still, the should tide one over until U6.

@Phaelax: Through the tests I've done, the positions are relative to the world coordinates.

Cheers,
Preston
Posted: 12th Jan 2004 10:00
Hey Preston,
It's six days later and I couldn't find this post for awhile. Just wanted to say thanks for the demo and a good understanding of the Vertex Functions.
Posted: 24th Jan 2004 16:01
I just learned how to use memblocks this afternoon, and I translated this to DBC. The format was no problem really, just had to fix the memblock byte position. It worked, but the code is very inefficient because of the make object command, where you have to delete and object then make one from a mesh again, whose performance hit is negligible when working with few meshes, but I tested it with 768 cones (32x24 cones that filled the screen) and it ran at 0 fps. It refreshed once every 3-5 seconds, but I really can't tell coz it was so slow