I have a problem here
Blitz3D Forums/Blitz3D Beginners Area/I have a problem here
| ||
day before yesterday i was creating a cube with an image applied to it that auto rotates something like that. ;Set 3D Mode Graphics3D 800,600 SetBuffer BackBuffer() ;Create a camera camera=CreateCamera() ;Create a light light=CreateLight() ;Create a cube cube=CreateCube() ;load texture tex=LoadTexture("Winter.jpg") ;make a brush brush=CreateBrush() ;Apply texture to brush BrushTexture brush,tex ;and some shininess BrushShininess brush,1 ;paint mesh with brush PaintMesh cube,brush While KeyDown(1) pitch#=0 yaw#=0 roll#=0 If KeyDown(31)=True Then pitch#=-1 If KeyDown(31)=True Then pitch#=1 If KeyDown(31)=True Then yaw#=-1 If KeyDown(31)=True Then yaw#=1 If KeyDown(31)=True Then roll#=-1 If KeyDown(31)=True Then roll#=1 ;position cube PositionEntity cube,0,0,5 ;turning object TurnEntity cube,pitch#,yaw#,roll# RenderWorld Flip Wend End I run it that day and it worked fine no errors nothing. Then yesterday came I run it again it loads up a black screen and shuts down very fast. Why is this happening? |
| ||
My B3D has been 1.90 for a while now. |
| ||
try with(out) the var#, floats should be specified as floats not integers, i think. |
| ||
The main loop starts like this: While KeyDown(1) which says to keep running as long as the escape key is held down. So the program ends immediately. |
| ||
For some reason when I use While KeyDown(1) It loads up and quit but when I change it into While Not KeyHit(1) It works perfectly no problem's |
| ||
Thats not suprising.While KeyDown(1) You are telling the main loop to only run when the "Escape" key is pressed. |