Yes. I would like to use the mesh as a pivot to move and point the camara at the same time.
So if it is possible I would love to have this as a feature.
Here is the code where I want to rotate the camera arounde the center of the Objects.
Code: Select all
MP_Graphics3DWindow(0,0,600,480,"Sin test 3D",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
MP_FrustumCulling(1)
cam.i=MP_CreateCamera()
MP_PositionCamera(cam,0,5,-5)
MP_CameraLookAt(cam,0,0,12.5)
lig=MP_CreateLight(2)
MP_PositionEntity(lig,0,5,5)
ang.f=-0.7
t.b=0
b1.i=MP_CreateSphere(24)
MP_EntitySetColor(b1,RGB(0,255,0))
MP_PositionEntity(b1,0,0,25)
b2.i=MP_CreateSphere(24)
MP_EntitySetColor(b2,RGB(0,255,0))
MP_PositionEntity(b2,0,0,20)
b3.i=MP_CreateSphere(24)
MP_EntitySetColor(b3,RGB(0,255,0))
MP_PositionEntity(b3,0,0,15)
b4.i=MP_CreateSphere(24)
MP_EntitySetColor(b4,RGB(0,255,0))
MP_PositionEntity(b4,0,0,10)
b5.i=MP_CreateSphere(24)
MP_EntitySetColor(b5,RGB(0,255,0))
MP_PositionEntity(b5,0,0,5)
b6.i=MP_CreateSphere(24)
MP_EntitySetColor(b6,RGB(0,255,0))
MP_PositionEntity(b6,0,0,22.5)
b7.i=MP_CreateSphere(24)
MP_EntitySetColor(b7,RGB(0,255,0))
MP_PositionEntity(b7,0,0,17.5)
b8.i=MP_CreateSphere(24)
MP_EntitySetColor(b8,RGB(0,255,0))
MP_PositionEntity(b8,0,0,12.5)
b9.i=MP_CreateSphere(24)
MP_EntitySetColor(b9,RGB(0,255,0))
MP_PositionEntity(b9,0,0,7.5)
p1.i=MP_CreateCube()
MP_PositionEntity(p1,0,5,25)
MP_MeshSetParent(b1,p1)
MP_MoveEntity(b1,0,-5,0)
p2.i=MP_CreateCube()
MP_PositionEntity(p2,0,5,20)
MP_MeshSetParent(b2,p2)
MP_MoveEntity(b2,0,-5.5,0)
p3.i=MP_CreateCube()
MP_PositionEntity(p3,0,5,15)
MP_MeshSetParent(b3,p3)
MP_MoveEntity(b3,0,-6,0)
p4.i=MP_CreateCube()
MP_PositionEntity(p4,0,5,10)
MP_MeshSetParent(b4,p4)
MP_MoveEntity(b4,0,-6.5,0)
p5.i=MP_CreateCube()
MP_PositionEntity(p5,0,5,5)
MP_MeshSetParent(b5,p5)
MP_MoveEntity(b5,0,-7,0)
p6.i=MP_CreateCube()
MP_PositionEntity(p6,0,5,22.5)
MP_MeshSetParent(b6,p6)
MP_MoveEntity(b6,0,-5.25,0)
p7.i=MP_CreateCube()
MP_PositionEntity(p7,0,5,17.5)
MP_MeshSetParent(b7,p7)
MP_MoveEntity(b7,0,-5.75,0)
p8.i=MP_CreateCube()
MP_PositionEntity(p8,0,5,12.5)
MP_MeshSetParent(b8,p8)
MP_MoveEntity(b8,0,-6.25,0)
p9.i=MP_CreateCube()
MP_PositionEntity(p9,0,5,7.5)
MP_MeshSetParent(b9,p9)
MP_MoveEntity(b9,0,-6.75,0)
MP_HideEntity(p1,1)
MP_HideEntity(p2,1)
MP_HideEntity(p3,1)
MP_HideEntity(p4,1)
MP_HideEntity(p5,1)
MP_HideEntity(p6,1)
MP_HideEntity(p7,1)
MP_HideEntity(p8,1)
MP_HideEntity(p9,1)
Repeat
ang+0.055
MP_RotateEntity(p1,0,0,Sin(ang*2)*45)
MP_RotateEntity(p6,0,0,Sin(ang*1.9)*47)
MP_RotateEntity(p2,0,0,Sin(ang*1.8)*50)
MP_RotateEntity(p7,0,0,Sin(ang*1.7)*53)
MP_RotateEntity(p3,0,0,Sin(ang*1.6)*55)
MP_RotateEntity(p8,0,0,Sin(ang*1.5)*57)
MP_RotateEntity(p4,0,0,Sin(ang*1.4)*60)
MP_RotateEntity(p9,0,0,Sin(ang*1.3)*63)
MP_RotateEntity(p5,0,0,Sin(ang*1.2)*65)
;MP_DrawText(10,10,StrF(ang,4))
MP_RenderWorld()
MP_Flip()
Until WindowEvent()=#PB_Event_CloseWindow Or MP_KeyHit(#PB_Key_Escape)
End