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.

DarkBASIC Professional Discussion / [b]structure of th command MAKE MEMBLOCK FROM MESH

Author
Message
delorme
23
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 1st Jun 2003 10:53
Hello

What is th structure of the command "MAKE MEMBLOCK FROM MESH"
size of the header
content of the header ....
there have not information of this sujet in the doc

Thank x-d
Sorry for my english,
Attreid
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 1st Jun 2003 11:33
an example made by Kevil :


"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
haggisman
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2003 12:45
with patch4+ all the default information in a memblock made from a mesh will be:

FVF format which is accessed using dword and is by default 274
FVF size which is also accessed using dword and is by default 32
Vertices number is the last part of the header.

They can be accessed like so:



They take up a total of 12 bytes altogether.

project: light/obscurance mapper (80% done)
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Jun 2003 13:30 Edited at: 1st Jun 2003 18:55
EDIT: Never mind, I hadn't realised the FVF format had been changed. Whoops.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
haggisman
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2003 17:02
It is 274 for fvf format and it is 32 for fvf size. after patch 3.1 the diffuse color was removed by default and so both variables changed to reflect this.



project: light/obscurance mapper (80% done)
delorme
23
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 1st Jun 2003 18:22
Ok

I have make a sphere and .... with the command "MAKE MEMBLOCK FROM MESH"

the first value is 274
the second is 32
and the number of vertice is 930

i modified the sphere with

for v=0 to (vnum*3)-1
rr#=wrapvalue(rr#+0.002)
r#=cos(rr#)*2
pos=vpos+(v*4)
val#=memblock float(1,pos)+r#
write memblock float 1,pos,val#
next v

but only 1/4 of the sphere is modified why?
If i have multiply the third value by 8 ( not 3 ) it's OK ?

Sorry for my english,
The Darthster
23
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 1st Jun 2003 18:43
Could it be you're writing texture and normal data by mistake when you try to write the vertex positions?

Remember, where v is the vertex number from 0 to memblock dword(1,8)-1:
Header - 12 bytes (when did 4*3=36, rob k?)
memblock dword(1,0) is the FVF format, usually 274
memblock dword(1,4) is the number of bytes per vertex
memblock dword(1,8) is the number of vertices

Rest of the data
memblock float(1,12+(v*32)+0) is the x position of the vertex
memblock float(1,12+(v*32)+4) is the y position of the vertex
memblock float(1,12+(v*32)+8) is the z position of the vertex

memblock float(1,12+(v*32)+12) is the x component of the normal
memblock float(1,12+(v*32)+16) is the y component of the normal
memblock float(1,12+(v*32)+20) is the z component of the normal

memblock float(1,12+(v*32)+24) is the u coordinate of the texture
memblock float(1,12+(v*32)+28) is the v coordinate of the texture

Once I was but the learner,
now, I am the Master.
delorme
23
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 1st Jun 2003 18:47
VERY THANK'S
x-d

Sorry for my english,
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Jun 2003 18:56
@haggisman

Yes, I take your point. I always created memblock objects from scratch, rather than doing Object > Mesh > Memblock so I never noticed the change. [Ahem!]

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jun 2003 21:44
Has anyone noticed any memory leaks when creating objects from meshes.

I wrote a wavy-flag thing a couple of months back (like everyone else seems to have done ) but dropped it when Patch4 came along. I've just recently resurrected it, but after a while, I start to get jittery performance, windows tells me I'm running low on virtual memory, and eventually it hangs.

Anyone else?

Login to post a reply

Server time is: 2026-07-11 14:56:02
Your offset time is: 2026-07-11 14:56:02