Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBPro] [DB "Classic" Untested] Several Vertex Manipulation Functions

Author
Message
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 4th Jan 2004 03: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


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 4th Jan 2004 03: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


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 4th Jan 2004 03: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


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
DrakeX
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 4th Jan 2004 03: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.

athlon xp 2000+ | radeon 9500 pro 128mb | 512MB crucial DDR | winXP pro | DBP P5.1b | B3D 1.85 | VC++ 6
predicted DBP P6 release date: March 28, 2004
predicted patch DBP will actually be useful: P18
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 4th Jan 2004 04:00
Quote: "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


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 4th Jan 2004 19:17
nice one mate!


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 4th Jan 2004 21:13
Quote: "I just ran the code that you gave me (source) in DBC & on line 112 'Program Ran Into Function Declaration'."


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




"Nowadays more and more of our imports are coming from abroad" - George Bush

Formerly David89.
burrbittyburr
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location:
Posted: 6th Jan 2004 09:27 Edited at: 6th Jan 2004 09: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

Specs[1 GiG Athlon,Geforce Ti4, 128mb]
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Jan 2004 10:51
Are the positions relative to the object's origin, or the world?
Preston C
20
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 7th Jan 2004 00: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


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
burrbittyburr
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location:
Posted: 12th Jan 2004 10:00 Edited at: 12th Jan 2004 10:01
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.

Specs[1 GiG Athlon,Geforce Ti4, 128mb]
Arkheii
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
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

Login to post a reply

Server time is: 2024-04-27 17:08:19
Your offset time is: 2024-04-27 17:08:19