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.

Author
Message
pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 8th Nov 2012 10:48

This is a piece of code involved in creating a matrix like object. I under stand the dword at memblock position 8 is the number of verts, but i don't understand whats being wrote to memblock location 0 and 4. What does fvf stand for and what does the 32 signify. 32 bit?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Nov 2012 11:18
FVF Binged in under a second...

pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 8th Nov 2012 11:47 Edited at: 8th Nov 2012 12:11
I've researched it further after your helpful link but still to no avail. I'm not understanding where he got 274 from unless it will always be dbp's call to direct x. Here's another link incase anyone else wants to know http://www.codesampler.com/d3dbook/chapter_05/chapter_05.htm

edit:
i also figured that the value in the 4 memory position is describing how many bytes of data are alotted to each vertex

double edit:
I understand the the fvf value is a flag number sent through to direct x but how do we determine this flag number. I know it specifies how the model information is handed over just don't know how to get the value
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Nov 2012 13:29 Edited at: 8th Nov 2012 13:30
http://forum.thegamecreators.com/?m=forum_view&t=166930&b=1

The Flexible Vertex Format is a way of telling DX what format your vertices are stored as. The most common one is 274, which is 32 bytes per vertex. The second most common one contains a diffuse value as well and is known as 338, which makes each vertex 36 bytes.

The default DBP FVF is 274, so lets see how that is calculated.



Every vertex in DBP has:

-3 floats for coordinates in 3D space
-3 floats for normal data
-2 floats for UV data

So:



Or in other words:

myFVF = 0x002 + 0x010 + 0x100 = 0x112 = 274

If you want your vertex to support diffuse, you just add that flag as well:



myFVF = 0x002 + 0x010 + 0x040 + 0x100 = 0x152 = 338

You have to make sure to change the vertex size in the memblock header as well.



The sizes can be looked up here.

You may also want to convert objects between two formats, in which case you may use the command:



TheComet

- The codebase
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Nov 2012 16:37
My old memblock matrix code might be helpful to ya:
http://forum.thegamecreators.com/?m=forum_view&t=32935&b=6&p=0

"You're not going crazy. You're going sane in a crazy world!" ~Tick
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Nov 2012 20:41
Quote: "ya"




TheComet

- The codebase
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Nov 2012 21:27
Just posting a link to my website articles on object memblocks; which you may also find useful:



pictionaryjr
17
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 8th Nov 2012 22:06
Phaelax thats actually where i got the code from lol. Thank you all so much. This helped a ton.

Login to post a reply

Server time is: 2026-07-10 18:11:09
Your offset time is: 2026-07-10 18:11:09