including "flag\\flag.bb" ;HELP!!!

Blitz3D Forums/Blitz3D Beginners Area/including "flag\\flag.bb" ;HELP!!!

Braden(Posted 2008) [#1]
ok, I'm new to adding programs to each other using the include command. I'm trying to add the flag.bb demo that comes with blitz3d to my project, but when I include it, all I see is the flag...
I've gotten rid of the include "start.bb" part of the flag code, and include graphics3d settings... What can I do to add the flag to my project, because all I see when I run my project is the flag...

thanks.


Naughty Alien(Posted 2008) [#2]
..you should extract usable function out of flag sample, and then include it..i guess what you did is just plain including of existing flag sample, and having said that, all rendering and main loop is in there (flag.bb) ?


Braden(Posted 2008) [#3]
Ok, I just added the main code that created the simple flag into my main program, and now it works... Thanks for your help

ALSO,

how would I position a custom mesh, here is the code...

Const segs=128,width#=4,depth#=.125

mesh=CreateMesh()
surf=CreateSurface( mesh )

For k=0 To segs
x#=Float(k)*width/segs-width/2
u#=Float(k)/segs
AddVertex surf,x,1,0,u,0
AddVertex surf,x,-1,0,u,1
Next

For k=0 To segs-1
AddTriangle surf,k*2,k*2+2,k*2+3
AddTriangle surf,k*2,k*2+3,k*2+1
Next

b=LoadBrush( "frenchflag.bmp" )
PaintSurface surf,b


Nate the Great(Posted 2008) [#4]
when you use the include statement it is just like taking the file that you included and pasting it into that one line that says include. if you copy the flag.bb as you have it and paste it instead of typing include you will see the obvious problem.

example


THIS IS WHAT YOU SEE

;flag.bb
draws a flag yay
end
;end of flag.bb


;your program
include "flag.bb"
does whatever
end
;end of your program



THIS IS WHAT THE COMPILER SEES

;your program

draws a flag yay
end

THE PROGRAM IS ENDED BEFORE IT GETS TO YOUR PROGRAM THUS DOING NOTHING BUT DRAWING THE FLAG

does whatever
end
;end of your program



Get it?


[edit] oops we posted at the same time... lol


Braden(Posted 2008) [#5]
AH, perfect sense, THANKS :>


Nate the Great(Posted 2008) [#6]
to answer your other question your custom mesh is called mesh so simply use

positionentity mesh,x#,y#,z#