Help! B3d crash

Archives Forums/Blitz3D SDK Programming/Help! B3d crash

Leon Drake(Posted 2008) [#1]
Im not sure whats causing the problem, both the mesh and surface exist. i get this



its when i run this particular function

Function offsetUV#(entity,surf,offx#,offy#)
If entity=0 Then Return 0
If surf = 0 Then Return 0
		For j=0 To bbCountVertices(surf)-1
			u#=Float(bbVertexU(surf,j))
			v#=Float(bbVertexV(surf,j))
			bbVertexTexCoords surf,j,u#+offx#,v#+offy#
			
			
		Next


	bbUpdateNormals entity



End Function



Leon Drake(Posted 2008) [#2]
i get this in the ouput

pure virtual method called
signal!:22
Received Signal


Moraldi(Posted 2008) [#3]
I can't help directly but my first thoughts are:
1. Are you sure surf is a valid handle?
2. Are you sure entity is 0? (You may already free the entity but not set entity = 0.)


Leon Drake(Posted 2008) [#4]
yea i checked that portion, both the surface and entity work, because the other function i have that paints a surface with a brush works just fine. Any time i use the bbvertextexcoords seems to crash the lib


skidracer(Posted 2008) [#5]
Can you try adding the following code to the flag demo in blitz3dsdk.mod/doc/samples/mak[25]:
For k=0 Until bbCountVertices(surf)
	u#=bbVertexU(surf,k)
	v#=bbVertexV(surf,k)
	bbVertexTexCoords surf,k,0,0,0,0
	bbVertexTexCoords surf,k,0,0,0,1
Next

This works for me in XP but we are fixing a few vista issues in next update so may fall into that category.

If the modified flag demo does work it may be you are destroying the integrity of the surface in some other part of your code.


Leon Drake(Posted 2008) [#6]
hmm, it didnt crash.

Weird i wonder why its goofing up in my app. both the entity and surface exist.

in the function parameters im passing

Float(Textfieldtext(mytextfield)) in the U and V parameters.


Leon Drake(Posted 2008) [#7]
BTW i am using vista


Leon Drake(Posted 2008) [#8]
Ok so i took out the Float(Textfieldtext(mytextfield)) and replaced them with a regular float variable and it didn't crash. I guess thats just something i'll have to watch out for.


Leon Drake(Posted 2008) [#9]
ah so i guess this bug is for the wrong forum after all

i tried doing this

myflt# = Float(Textfieldtext(mytextfield))

and it bombed out


Leon Drake(Posted 2008) [#10]
OMG!!! i suck. im sorry hahaha

i had textareatext not textfieldtext

womp womp waa.