Skip to main content
gamedev.net
🔒 Locked

Adjacencies

Started by Omid 4 replies 600+ views
Original Post
Omid
Omid
hey, I''m having a really hard time getting the GenerateAdjacency function to work. I keep getting Automation error when calling the function. I figure my fault must be when I create the Buffer or perhaps when creating the mesh. Here''s a snipet of the code (and btw it''s in VB): ---------------------------------------------------------------- Dim Adj As D3DXBuffer Dim Float As Single Set Adj = g_d3dx.CreateBuffer(12# * Mesh.GetNumFaces) Mesh.GenerateAdjacency 0, ByVal Adj.GetBufferPointer ---------------------------------------------------------------- The value 12 comes from the Length of a single, which is four, times three. This is the size which DX SDK tells me to use:
quote:
Make sure that the size of this array is at least 3 * GetNumFaces * Len(Single) bytes long.
Thanx in advance regards, /omid
SimDemon
SimDemon
Quote:
Make sure that the size of this array is at least 3 * GetNumFaces * Len(Single) bytes long.

You are only using 12# * Mesh.GetNumFaces, but it says "3 * GetNumFaces * Len(Single)", so wouldn''t you use:

Set Adj = g_d3dx.CreateBuffer(3 * 12# * Mesh.GetNumFaces)

If thispost = 0 Then
GoBack()

Else
Read()
End If
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
IndirectX
IndirectX
Try the debug runtime.
---visit #directxdev on afternet <- not just for directx, despite the name
Omid
Omid
quote:
Original post by SimDemon
Quote:
Make sure that the size of this array is at least 3 * GetNumFaces * Len(Single) bytes long.

You are only using 12# * Mesh.GetNumFaces, but it says "3 * GetNumFaces * Len(Single)", so wouldn''t you use:

Set Adj = g_d3dx.CreateBuffer(3 * 12# * Mesh.GetNumFaces)

If thispost = 0 Then
GoBack()

Else
Read()
End If


Simdemon, Len(Single) = 4, so Len(Single) * 3 = 12, thus
3 * Len(Single) * Mesh.GetNumFaces = 12# * Mesh.GetNumFaces

Indirectx, I''ll try that. is the debug outputted to a file?

Thanx for the replies

regards,
/omid
Omid
Omid
arghh! damn double posts. my IE keeps screwin'' up

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.