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.

3 Dimensional Chat / a unsmart but simple question!

Author
Message
black_mage
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 29th Jun 2003 19:58
ive been pondering on this for awhile and somehow havent yet figured it out.

How do I change a point (like a corner) for a 3d model or mesh?

How do you add more, etc..?

Is it anything to do with vectors?

If so where can I find a decent vector tutorial?

i know its lots of questions but thanks in advance
Hello!
I like rpgs! Do you?
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 29th Jun 2003 22:07
black_mage , I can't answer your question about changing vertex locations in DBPro since I haven't played with the approach, but you can find lots of resources on Vector math and tutorials at http://www.gamedev.net. Look under their resources link and search for the relavent documents you're looking for

APEX!

MSI/AMD Athlon 1300, 256Mb, 60GbHD, SoundBlaster Live!, GeForce 4 MX440-64Mb, Win2K, DX9, DarkBASIC Pro(PUv4.1)
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 30th Jun 2003 02:26


it isn't a stupid question as they completely changed the memblock setup and didn't explain how the new FVF setup works

I pride myself that i don't kill... well not without a good reason
black_mage
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 1st Jul 2003 13:09
ok, thanks... ill see if i get to understand that someday........

Hello!
I like rpgs! Do you?
Critters
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location: United Kingdom
Posted: 1st Jul 2003 16:37
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Jul 2003 20:03
the memblock setup is
(positions are done in bytes from 0)

position 0 - dword (4byte) = fvf version
position 4 - dword (4byte) = size of vertex data
position 8 - dword (4byte) = number of vertex


then you have the vertex data which the first bit of data always starts at position 12 as this is the size of the header (the data above)

so each vertex offset would be
offset = 12 + ( vertexnumber * size of vertex data )

FVF is an odd format which doesn't have a specific setup, so your vertex data setup although linear in design can change

the fvf version 338 (standard db version) includes the following data

Vertex Position
Vertex Normal
Vertex Colour
Vertex Texture Coords

the position & normal are a 3D vector which means 3 floats to represent X Y Z

position offset+0 - float (4byte) = x position
position offset+4 - float (4byte) = y position
position offset+8 - float (4byte) = z position

position offset+12- float (4byte) = x normal
position offset+16- float (4byte) = y normal
position offset+20- float (4byte) = z normal


a normal is just the default position of a standard light, when more than one vertex uses the same normal (lightsource) this allows them to blend together to create a smooth shading across the surface.

next you have the vertex colour aka diffuse colour, this is a simple RGB() value (which is a dword)

position offset+24- dword (4byte) = diffuse colour (rgb(red,green,blue))

and finally we have the texture points, these are float values which tell the program where on a bitmap the vertex is positioned ...
its from 0.0-100.0 so for a 256x256 bitmap 0=0pixel and 100=256pixel, the program calculates based on the size where you vertex would actually be then displays the image across the surface based on where the other three vertex in the face are.

position offset+28- float (4byte) = width (u) texture coord
position offset+32- float (4byte) = height(v) texture coord


there are more formats that FVF can follow, and in the help they are listed within the order in which you use them,

Vertex & Normal Data
Extra Data (Colours and such)
Texture Data

is really the entire setup, and they'll appear in the memblock in the exact order listed here



theres obviously a little more to it, and if you use FVF_XYZRHW instead of FVF_XYZ or FVF_XYZBn then you don't use Normal

to declare a new FVF Type all you do select which of the FVF setup you want to use, the you declare it by using the values above using a '||' between them and then using the Convert Object FVF command.
so like

Convert Object FVF object, (FVF_XYZ||FVF_NORMAL||FVFTEX1)

Login to post a reply

Server time is: 2024-05-20 09:08:24
Your offset time is: 2024-05-20 09:08:24