Does someone know why the ENT = CreateEntity(#PB_Any, MeshID(LIN), #PB_Material_None,0,0,0,-1,#Mask2) does not work in the below example code ?
Thanks in advance
Code: Select all
#Mask1 = 1 << 0 ;binary 1
#Mask2 = 1 << 1 ;binary 2
InitEngine3D()
InitSprite()
OpenWindow(0, 0, 0, 640, 480, "Line3D example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 640, 480, 0, 0, 0)
; Light
CreateLight(#PB_Any, RGB(25, 25, 180), -5, 10, 5, #PB_Light_Point)
; Camera
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 2, 1, 3, #PB_Absolute | #PB_Local)
CameraLookAt(0, 0, 0, 0)
; Create the line and attach it to the scene
OBJ = CreateNode(#PB_Any,0,0,0)
LIN = CreateLine3D(#PB_Any, 0, 0, 0, RGB(255, 0, 0), 1, 1, 1, RGB(0, 0, 255))
ENT = CreateEntity(#PB_Any, MeshID(LIN), #PB_Material_None,0,0,0,-1,#Mask2)
AttachNodeObject(OBJ,EntityID(ENT))
Repeat
RenderWorld()
FlipBuffers()
Until WaitWindowEvent(1) = #PB_Event_CloseWindow