Re: Physics need a fix?
Posted: Sun Jun 29, 2014 7:35 pm
If you write it un-personalized/non-personal, like "the human brain...", it would sound better in my opinion.Bananenfreak wrote:But there´s a Problem with your brain.
http://www.purebasic.com
https://www.purebasic.fr/english/
If you write it un-personalized/non-personal, like "the human brain...", it would sound better in my opinion.Bananenfreak wrote:But there´s a Problem with your brain.
Code: Select all
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>> >>
;>> Name: 3D-Template >>
;>> >>
;>> Author: Bananenfreak >>
;>> >>
;>> Date: 03.07.2014 >>
;>> >>
;>> OS: Windows >>
;>> >>
;>> >>
;>> >>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EnableExplicit
Define.f KeyX, KeyY, MouseX, MouseY
Define nx.f, nz.f, Boost.f = 1, Yaw.f, Pitch.f
Define.i Quit, boden, mCube
Dim cubes.i(3)
#kam_0 = 0
#window = 0
#plane = 0
#planent = 0
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Scripts", #PB_3DArchive_FileSystem)
Parse3DScripts()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(#window, 0, 0, 1800, 1000, "3D-Template", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(#window), 10, 10, 2000, 2000, 0, 10, 10, #PB_Screen_SmartSynchronization)
WorldShadows(#PB_Shadow_TextureAdditive, 200, RGB(255 * 0.2, 255 * 0.2, 255 * 0.2), 4096)
AmbientColor(RGB(255 * 0.2, 255 * 0.2, 255 * 0.2))
CreatePlane(#plane, 100, 100, 100, 100, 100, 100)
boden = GetScriptMaterial(#PB_Any, "Scene/GroundBlend")
CreateEntity(#planent, MeshID(#plane), MaterialID(boden), 0, 0, 0)
mCube = CreateCube(#PB_Any, 1)
cubes(0) = CreateEntity(#PB_Any, MeshID(mCube), #PB_Material_None, 10, 0.5, 10)
cubes(1) = CreateEntity(#PB_Any, MeshID(mCube), #PB_Material_None, 0, 1, 0)
cubes(2) = CreateEntity(#PB_Any, MeshID(mCube), #PB_Material_None, 0, 0.5, 10)
cubes(3) = CreateEntity(#PB_Any, MeshID(mCube), #PB_Material_None, 0, 0, 0)
AttachEntityObject(cubes(0), "", EntityID(cubes(1)), -1, 0, 1, 0, 45, 0)
;-Camera
CreateCamera(#kam_0, 0, 0, 100, 100)
MoveCamera(#kam_0, 0, 20, 0, #PB_Absolute)
CameraLookAt(#kam_0, 20, 0, 20)
CameraRange (#kam_0, 2, 5000)
CameraFOV (#kam_0, 90)
CameraBackColor(#kam_0, RGB(0, 0, 0))
Repeat
Repeat
Until WindowEvent() = 0
If ExamineMouse()
Yaw = -MouseDeltaX() * 0.05
Pitch = -MouseDeltaY() * 0.05
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Up)
MoveCamera(0, 0, 0, -1 * Boost)
ElseIf KeyboardPushed(#PB_Key_Down)
MoveCamera(0, 0, 0, 1 * Boost)
EndIf
If KeyboardPushed(#PB_Key_Left)
MoveCamera(0, -1 * Boost, 0, 0)
ElseIf KeyboardPushed(#PB_Key_Right)
MoveCamera(0, 1 * Boost, 0, 0)
EndIf
EndIf
RotateCamera(0, Pitch, Yaw, 0, #PB_Relative)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End
Doc is wrong, it's always Pitch, Yaw, RollThade wrote: AttachEntityObject(#Entity, Bone$, ObjectID [, x, y, z, Pitch, Roll, Yaw])
Description: Attach an existing object to an entity bone. An object can be detached from an entity with DetachEntityObject().
But why is it Pitch Roll Yaw in AttachEntityObject instead of Pitch Yaw Roll?
That's right those arguments are used only for bones, else it can be done this way :Bananenfreak wrote: How to handle with those additional arguments?
Here I have a code, but they don´t seem to work?!
Code: Select all
AttachEntityObject(cubes(0), "", EntityID(cubes(1)))
MoveEntity(cubes(1), -1, 0, 1)
RotateEntity(cubes(1), 0, 45, 0)
Oh, then this would be also a good information for the doc.Comtois wrote:That's right those arguments are used only for bones, else it can be done this way :Bananenfreak wrote: How to handle with those additional arguments?
Here I have a code, but they don´t seem to work?!Code: Select all
AttachEntityObject(cubes(0), "", EntityID(cubes(1))) MoveEntity(cubes(1), -1, 0, 1) RotateEntity(cubes(1), 0, 45, 0)