It is currently Thu Feb 27, 2020 8:37 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: AttachEntityObject() coordinates are ignored
PostPosted: Fri Nov 23, 2018 8:26 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4597
Location: Spa, relaxing and thinking, and learning...
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.

Code:
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)

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: AttachEntityObject() coordinates are ignored
PostPosted: Sat Nov 24, 2018 10:29 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 823
Location: Denmark
True..The AttachEntityObject() parameters are ignored.

_________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.”
— Benjamin Franklin
Current configurations: Windows 10, Intel 6800K, GeForce Gtx 1060, 32 gb ram.


Top
 Profile  
Reply with quote  
 Post subject: Re: AttachEntityObject() coordinates are ignored
PostPosted: Sat Nov 24, 2018 3:34 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 19, 2003 11:36 am
Posts: 1418
Location: Doubs - France
position and rotation are used by bones.

You can use MoveEntity()

Code:
 CreateEntity(2,MeshID(1),MaterialID(0))
 AttachEntityObject(0,"",EntityID(2))
 MoveEntity(2,1,0,0)

_________________
Please correct my english
http://purebasic.developpez.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: AttachEntityObject() coordinates are ignored
PostPosted: Sat Nov 24, 2018 6:16 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4597
Location: Spa, relaxing and thinking, and learning...
Comtois wrote:
position and rotation are used by bones.

You can use MoveEntity()

Code:
 CreateEntity(2,MeshID(1),MaterialID(0))
 AttachEntityObject(0,"",EntityID(2))
 MoveEntity(2,1,0,0)

I suspected just that. However there would be necessary a note about it in the manual.

Instead to add a MoveEntity() command it can be done in the CreateEntity() position parameters:
Code:
 CreateEntity(2,MeshID(1),MaterialID(0),1,0,0)
 AttachEntityObject(0,"",EntityID(2))

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye