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
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 12th Jun 2009 04:35
If I wanted to create a mesh from a memblock
what would be the math to determine all this stuff:



like how many normals do i have to a vertice and stuff like that
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 12th Jun 2009 04:44
here:

http://forum.thegamecreators.com/?m=forum_view&t=149560&b=10

that will answer some of ur questions if not all

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 12th Jun 2009 05:59
Alright that helped me understand the vertexes, vectors, and normals, but what about the UV texture data stuff
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 12th Jun 2009 06:13
UV texture data is x and y offsets for applying texture to an object

U = X
V = Y

so 0 and 0 map the texture like default, 1 and 0 will move the texture one.......... unit to the right (i have no idea what to call that unit)

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 12th Jun 2009 06:39
lol o well that easy enough. I'll see what kind of code i can whip up tomorrow to see if i understand everything.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 12th Jun 2009 06:54
good luck, thats what i thought when i started my thread (link above)

but once i learned the complexities involved in doing so I just said screw it

There are only 10 kinds of people in the world, those who understand binary and those who dont
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 12th Jun 2009 17:28 Edited at: 12th Jun 2009 18:16
lol thats probably what i'll end up doing

EDIT:
All right, I figured out this much. Correct me if I'm wrong.
starting with the number of vertices.
If I were to create an object with 5 vertices here would be the maths.

VertNum=5
VertPos=32
NormNum=VertNum
NormPos=(NormNum*12)+VertPos
FaceNum=6 *I'm trying to make a pyramid shape*
FacePos=? *I can't figure out the math to determine it*
FaceSize=FaceNum*7
UVData=(FaceSize*4)+FacePos

Thats as far as I've gotten, I need the facepos to finish, because i belive i understand the normals.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Jun 2009 01:52
Looks like you just about got it. The faces follow the norms so your face data start point should be

FacePos=NormPos+(NormNum*12)

I can't remember the face layout offhand and don't have anything in front of me to look it up. The one thing I do remember is the face data size is dwords not bytes like the other data.

Looks like you are on the right track. You can do a quick check to understand the format better if you create a plain. Make a mesh and a memblock out of, then look at all of the data in the memblock and see how it relates to the header description from the manual.

Enjoy your day.
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 17th Jun 2009 06:14
haha already did that with most of the objects lol.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Jun 2009 17:24 Edited at: 17th Jun 2009 17:24
Quote: "FaceNum=6 *I'm trying to make a pyramid shape*"

A pyramid has five sides, or a triangular one has four.

[edit]
sorry, one of the faces is a square so two triangles

There is an eight letter word. You can insert a letter into it or remove a letter from it without changing its meaning. Answer

Login to post a reply

Server time is: 2024-05-20 12:52:04
Your offset time is: 2024-05-20 12:52:04