AttachEntityObject() coordinates are ignored
Posted: Fri Nov 23, 2018 8:26 pm
Take a look to this one.
just run it as it is.
Then uncomment the remarked lines and comment the other 2 ones, then run again.
The result is different and i suspect AttachEntityObject() coordinates parameters are ignored.
just run it as it is.
Then uncomment the remarked lines and comment the other 2 ones, then run again.
The result is different and i suspect AttachEntityObject() coordinates parameters are ignored.
Code: Select all
RX.u=1024:RY.u=768
InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
Parse3DScripts()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,RX,RY,"tip",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,RX,RY,0,0,0,#PB_Screen_WaitSynchronization)
CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,3,#PB_Absolute)
LoadTexture(0,"terrain_detail.jpg")
CreateMaterial(0,TextureID(0))
CreateCylinder(0,0.2,1)
CreateSphere(1,0.2)
CreateEntity(0,MeshID(0),MaterialID(0),0,0,0)
;These 2 lines does work because coordinates in parameters for CreateEntity() are performed:
CreateEntity(2,MeshID(1),MaterialID(0),1,0,0)
AttachEntityObject(0,"",EntityID(2))
;These 2 lines does not work because coordinates in the parameters of AttachEntityObject() are ignored:
; CreateEntity(2,MeshID(1),MaterialID(0))
; AttachEntityObject(0,"",EntityID(2),1,0,0,0,0,0)
Repeat
WaitWindowEvent()
ExamineKeyboard()
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)