forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   3D-программирование (http://forum.boolean.name/forumdisplay.php?f=12)
-   -   BodyCreateHull (http://forum.boolean.name/showthread.php?t=5567)

Stimorol 13.01.2008 19:09

BodyCreateHull
 
Помогите перевести код из Blitz3D в Visual Basic 6.

Код:


Function BodyCreateHull%(mesh%)
Local nsurf = CountSurfaces(mesh)
Local nvert = 0
For ns = 1 To nsurf
Local surf = GetSurface(mesh,ns)
nvert = nvert + CountVertices(surf)
Next
vbank = CreateBank(nvert*4*3)
nv = 0
For ns = 1 To nsurf
surf = GetSurface(mesh,ns)
nvv = CountVertices(surf)
For nvc = 0 To nvv - 1
PokeFloat vbank,nv*12+0,VertexX(surf,nvc)
PokeFloat vbank,nv*12+4,VertexY(surf,nvc)
PokeFloat vbank,nv*12+8,VertexZ(surf,nvc)
nv = nv+1
Next
Next
Local bbb%= pxCreateHull(vbank, nvert, 10)
FreeBank vbank
Return bbb
End Function

Или хотяб подскажите что означает следующие функции:
CreateBank
PokeFloat
FreeBank

PS. С меня пиво ;)

tormoz 13.01.2008 19:34

Ответ: BodyCreateHull
 
Код:

CreateBank ([size])
Parameters
size - size of memory bank in bytes (default is 0 bytes) 

Description
The bank commands allow you to perform high-speed data operations on a block of memory. This is useful for writing your own compression/decompression routines, passing and receiving data to and from a DLL and more. Banks start at 0 and finish at size-1.

The data types available for use with a bank are:

Byte - takes up one byte. Values can be in the range 0 to 255.
Short - takes up two bytes. Values can be in the range 0 to 65535.
Int - takes up four bytes. Values can be in the range -2147483647 to 2147483647.
Float - takes up four bytes. Values can be in the range -3.4x10ЈјѓVѓZ to 3.4x10ѓVѓZ

See also: FreeBank. 

Example
; Bank Commands Example
; ---------------------

bnkTest=CreateBank(12)

PokeByte bnkTest,0,Rand(255)
PokeShort bnkTest,1,Rand(65535)
PokeInt bnkTest,3,Rand(-2147483648,2147483647)
PokeFloat bnkTest,7,0.5

Print PeekByte(bnkTest,0)
Print PeekShort(bnkTest,1)
Print PeekInt(bnkTest,3)
Print PeekFloat(bnkTest,7)

FreeBank bnkTest 


PokeFloat bank,offset,value
Parameters
bank - bank handle
offset - offset in bytes, that the poke operation will be started at
value - value that will be written to bank 

Description
Writes a float into a memory bank.

A float takes up four bytes of a memory bank.


impersonalis 13.01.2008 19:56

Ответ: BodyCreateHull
 
http://forum.boolean.name/showthread.php?t=4


Часовой пояс GMT +4, время: 15:02.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot