Now i try to write an script, called to draw 3d rotated blocks into one stroke yet.
So this is my script, written in PB 5.6.2 on Windows XP:
Delete Cube Stroke, PB5.6.2 on Windows XP
Code: Select all
;****************************************************************************************************************
;Delete Cube Stroke (Rotated)
;****************************************************************************************************************
;Initializing
If InitEngine3D() = 0
MessageRequester("Fatal Error", "Failed to Initialize Engine3D.dll", #PB_MessageRequester_Error)
End
EndIf
If InitSprite() = 0
MessageRequester("Fatal Error", "Failed to Initialize Sprites", #PB_MessageRequester_Error)
End
EndIf
If InitKeyboard() = 0
MessageRequester("Fatal Error", "Failed to Initialize Keyboard", #PB_MessageRequester_Error)
End
EndIf
If OpenScreen(640, 480, 32, "", #PB_Screen_NoSynchronization) = 0
MessageRequester("Fatal Error", "Failed to Open Screen", #PB_MessageRequester_Error)
End
EndIf
;Call Variables and Enummerates
Declare Start3DWorld()
Global NewList Blocks.i()
Global Time.i = 4
Enumeration
#Light_Dir
#Light_Point1
#Light_Point2
#Player
#Mesh
#Entity
#Node
EndEnumeration
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;Starts 3D
Procedure Start3DWorld()
CreateLight(#Light_Dir, RGB(255, 255, 200), 0, 0, 0, #PB_Light_Directional)
CreateLight(#Light_Point1, RGB(255, 100, 100), 2, 1, 2, #PB_Light_Point)
CreateLight(#Light_Point2, RGB(100, 255, 255), -2, -1, -2, #PB_Light_Point)
CreateCamera(#Player, 0, 0, 100, 100)
MoveCamera(#Player, 0, 0, 100)
RotateCamera(#Player, 0, 0, 100)
CreateCube(#Mesh, 1)
CreateEntity(#Entity, MeshID(#Mesh), #PB_Material_None)
CreateNode(#Node, 0, 0, 0)
For I = 0 To 24 Step 2
AddElement(Blocks())
Blocks() = CopyEntity(#Entity, #PB_Any)
MoveEntity(Blocks(), I, 0, 0, #PB_Absolute)
AttachNodeObject(#Node, EntityID(Blocks()))
Next I
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Delete)
DeleteElement(Blocks())
EndIf
EndProcedure
;Render3D World and ask if player will be Exit this Program
Start3DWorld()
Repeat
ExamineKeyboard()
RotateNode(#Node, 1, 1, 1, #PB_Relative)
RenderWorld()
FlipBuffers()
ClearScreen(0)
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
ForEver
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;END Program
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
my software yet)... If you press 'Delete', the cubes stroke must be deleted, but it doesn't... So look to this script,
to try see whats bad on my code, run this script and try to press the 'Delete Key' on the keyboard..., you will be
see thads the cubes don't will delete, just it don't works.
I get my cubes (Block Stroke) called into an AddElement(Blocks()) Function, but DeleteElement isn't works yet.
So pleace find whats bad on my code and if you see whats bad (but its not an error, just 'EnableExiplite' don't
should help such i think, its just an 'not working' whay the block stroke will not be delete if you press 'Delete Key'...),
pleace try to find the problem and correct my code yet..., just i can experiment with elements in 3d...
So Pleace correct my code and i hope its helps... Can you correct my code to fix this DeleteElement(Blocks()) Problem?,
Thanks for help, Jamie.