It is currently Fri Oct 18, 2019 2:26 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Undocumented function EntityMesh()
PostPosted: Sun Mar 31, 2019 2:25 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 778
Location: Denmark
Hi
What is the purpose of
Code:
EntityMesh(#Entity, MeshID)
?

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Undocumented function EntityMesh()
PostPosted: Sun Mar 31, 2019 5:01 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5834
Location: Wales, UK
Hi DK_PETER

Referenced here:
https://github.com/SicroAtGit/PureBasic-CodeArchiv-Rebirth/blob/master/Gadget/ScintillaGadget/ScintillaText/PBFunctionList.txt

It says:
EntityMesh (#Entity, MeshID) - Change the #Entity mesh with the new one.

...but I'm not sure the description is correct - if it is correct, then surely the function name could be better, to suggest it's purpose.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: Undocumented function EntityMesh()
PostPosted: Sun Mar 31, 2019 6:21 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 778
Location: Denmark
Hi IdeasVacuum

That was my initial thought. But unless I'm missing a step somewhere or my interpretation of
what the function should do is wrong, I can't seem to get it working.
It might not work at all and completely redundant. :)


Code:
InitEngine3D()
InitSprite()
InitKeyboard()

OpenWindow(0, 0, 0, 800, 600, "EntityMesh", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0, 5)
CreateLight(0, $FF00FF, -2, -3, 0)
CreateSphere(0, 2) ;Mesh 0
CreateCube(1, 2)   ; Mesh 1
CreateTexture(0, 512, 512)
StartDrawing(TextureOutput(0))
DrawingMode(#PB_2DDrawing_AlphaBlend|#PB_2DDrawing_Gradient)
FrontColor($00005200) : BackColor($FF005200)
For y = 0 To 512 Step 16
  For x = 0 To 512 Step 16
    BoxedGradient(x, y, 512, 4)
    Box(0, y, 512, 4)
  Next x
Next y
StopDrawing()
CreateMaterial(0, TextureID(0))
MaterialBlendingMode(0, #PB_Material_Add)
MaterialCullingMode(0, #PB_Material_NoCulling)
CreateEntity(0, MeshID(0), MaterialID(0), 0, 0, 0) ; Entity 0
ScaleMaterial(0, 0.5, 0.5)

Repeat
  Repeat : ev = WindowEvent() : Until  ev = 0
 
  ExamineKeyboard()
 
  If KeyboardReleased(#PB_Key_F1)
    EntityMesh(0, MeshID(1))
    Debug "Swap mesh in entity with Cube"
  ElseIf KeyboardReleased(#PB_Key_F2)
    EntityMesh(0, MeshID(0))
    Debug "Swap mesh in entity with Sphere"
  EndIf
 
  RenderWorld()

  FlipBuffers()
 
Until KeyboardPushed(#PB_Key_Escape)

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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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