Jump to content

[Blitz3D Help] Need help with this code

- - - - -

  • Please log in to reply
No replies to this topic

#1
Skyfe

Skyfe

    Newbie

  • Members
  • Pip
  • 2 posts
Hi everyone,

I've used Blitz3D for about just 2 days yet, and I'm creating a 3d tool, but am getting 1 error and am having 1 problem;
- "Memory access violation (just when the program runs for about 2 minutes or something, no matter WHAT I do while running my "program")"
- When it should count the surfaces of the box just created, it counts 0 surfaces...

First about the surfaces, this part counts and shows the amount of surfaces (which says it's 0 surfaces, which isn't true...(should be 1 or so))


...

While Not KeyDown(1)

...

;creates the box when the user clicks on the screen

If mode$="CreateCube" Then 



      If MouseHit(1) > 0 Then 

	  Boxes = Boxes + 1

      Cube(Boxes) = CreateCube()

      cube_x = MouseX()/factor#

      cube_y = MouseY()/factor2

      PositionEntity Cube(boxes),cube_x,1,5

      TurnEntity Cube(boxes),0,60,0

      CubeSurfaces(Boxes) = CountSurfaces(Cube(Boxes))

      mode$ = "ScaleCube"

      EndIf 



EndIf

...

RenderWorld 

;shows the amount of surfaces of the created box(es)

For am = 0 To boxes

 If am > 0 Then Text 0,am*10,"Box"+am+":"+CubeSurfaces(am)+" Surfaces, x vertices, x polygons"

Next


So what could be wrong with this?

And the Memory access violation error I get from this part:


button9 = LoadImage( "C:\Documents and Settings\JDB\Mijn documenten\Skyfes Modeling Tool\button9.bmp" )

MaskImage button9,0,0,0

DrawImage button9,850,240


but first I got it from another loadimage, very strange since all the buttons it loads in the same way and are all .bmp, but only with 1 button I'm getting this error each time...

And sO what's/could be, wrong? (with both/one)

Thanks in advance!

Skyfe.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users