Physics EXAMPLES need a fix?

Everything related to 3D programming
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Physics need a fix?

Post by Danilo »

Bananenfreak wrote:But there´s a Problem with your brain.
If you write it un-personalized/non-personal, like "the human brain...", it would sound better in my opinion.
coco2
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

Re: Physics need a fix?

Post by coco2 »

Anything in reference to "your brain" is usually always considered sarcastic and an insult in english. When a native English speaker reads your post they may still conclude that you are not trying to insult and can understand what you are saying. What you are describing is an effect of the "human brain's perception".
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Physics need a fix?

Post by Bananenfreak »

Ok, no personal address anymore ;)
Thank you for your help.
Image
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Physics need a fix?

Post by infratec »

@Thade

what Bananenfreak ment was:

The human brain and not someones special brain.

Like the optical effects from M.C. Escher which makes use of the 'faults' in our brains.

Bernd

Don't know why, I'm always to late. :oops:
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: Physics EXAMPLES need a fix?

Post by Thade »

Thanks for the explanations :)

Back to physics ...

The manual (physics commands) is not very clear in many cases (actually it is hard for me to understand what is meant in many cases) - but sometimes its even confusing:

EntityFixedYawAxis(#Entity, Enable [, VectorX, VectorY, VectorZ])
Description: Change the fixed yaw axis of the entity. The default behaviour of a entity is to yaw around its own Y axis.

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().

In Blitz3D and all other 3d-Engines I know its Pitch Yaw Roll around x y z
And in the description of EntityFixedYawAxis I read: The default behaviour of a entity is to yaw around its own Y axis. What I find normal.
But why is it Pitch Roll Yaw in AttachEntityObject instead of Pitch Yaw Roll?
Last edited by Thade on Sun Aug 03, 2014 3:29 am, edited 1 time in total.
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Physics need a fix?

Post by Bananenfreak »

I think this is referenced the wrong way...
In the Infoline in bottom of the IDE there is Yaw on right place (Second angle Argument).

Another question:
How to handle with those additional arguments?
Here I have a code, but they don´t seem to work?!

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
Image
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Physics need a fix?

Post by Comtois »

Thade 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?
Doc is wrong, it's always Pitch, Yaw, Roll
Please correct my english
http://purebasic.developpez.com/
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Physics need a fix?

Post by Comtois »

Bananenfreak wrote: How to handle with those additional arguments?
Here I have a code, but they don´t seem to work?!
That's right those arguments are used only for bones, else it can be done this way :

Code: Select all

  AttachEntityObject(cubes(0), "", EntityID(cubes(1)))
  MoveEntity(cubes(1), -1, 0, 1)
  RotateEntity(cubes(1), 0, 45, 0)
Please correct my english
http://purebasic.developpez.com/
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: Physics need a fix?

Post by Bananenfreak »

Comtois wrote:
Bananenfreak wrote: How to handle with those additional arguments?
Here I have a code, but they don´t seem to work?!
That's right those arguments are used only for bones, else it can be done this way :

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.
Image
Post Reply