It is currently Tue Sep 25, 2018 2:16 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How to use MeshVertex in PB 570b1
PostPosted: Thu May 31, 2018 3:00 pm 
Offline
Addict
Addict

Joined: Sun Jun 25, 2006 7:28 pm
Posts: 1324
- Added: BuildMeshManualLod(), BuildMeshLod(), MeshVertex(),
CreateDataMesh()

How to use MeshVertex ?
Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: How to use MeshVertex in PB 570b1
PostPosted: Thu May 31, 2018 3:04 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13371
Location: France
MeshVertex() is an all-in-one function to define a vertex, instead of using MeshVertexPosition, MeshVertexColor, MeshVertexNormal
and MeshVertexTextureCoordinate


Top
 Profile  
Reply with quote  
 Post subject: Re: How to use MeshVertex in PB 570b1
PostPosted: Tue Jul 10, 2018 4:40 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 742
Location: Denmark
Any chance for a small example?
Edit:
There is something wrong with the number of parameters.
TIA

_________________
“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: How to use MeshVertex in PB 570b1
PostPosted: Wed Jul 11, 2018 11:24 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13371
Location: France
You are right, it will be fixed with in the next beta


Top
 Profile  
Reply with quote  
 Post subject: Re: How to use MeshVertex in PB 570b1
PostPosted: Wed Jul 11, 2018 2:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 742
Location: Denmark
@Fred
Thanks ;-)

;Basic Example without knowing what the last parameter does. :-)
Code:
InitEngine3D()
InitSprite()
InitKeyboard()

ExamineDesktops()
OpenWindow(0, 0, 0, DesktopWidth(0), DesktopHeight(0), "MeshVertex", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0), WindowHeight(0))
CreateCamera(0, 0, 0, 100, 100)

CreateMesh(0)  ;just testing
MeshVertex( 0.5,   0, -0.5,   0,   1,   0,   0,   1,   0, 0.5)
MeshVertex(-0.5,   0, -0.5,   1,   1,   0,   0,   1,   0, 0.5)
MeshVertex( 0.5,   0,  0.5,   0,   0,   0,   0,   1,   0, 0.5)
MeshVertex(-0.5,   0,  0.5,   1,   0,   0,   0,   1,   0, 0.5)
MeshVertex( 0.5,   0, -0.5,   0,   1,   0,   0,   1,   0, 0.5)
MeshVertex(-0.5,   0, -0.5,   1,   1,   0,   0,   1,   0, 0.5)
MeshVertex( 0.5,   0,  0.5,   0,   0,   0,   0,   1,   0, 0.5)
MeshVertex(-0.5,   0,  0.5,   1,   0,   0,   0,   1,   0, 0.5)
MeshVertex( 0.5,   0, -0.5,   0,   1,   0,   0,   1,   0, 0.5)
FinishMesh(#True)

CreateTexture(0, 60, 60)
StartDrawing(TextureOutput(0))
FrontColor($333333) : BackColor($FFFFFF)
DrawingMode(#PB_2DDrawing_Gradient)
BoxedGradient(0, 0, 60, 60)
Box(0, 0, 60, 60)
StopDrawing()
CreateMaterial(0, TextureID(0)) : MaterialCullingMode(0, #PB_Material_NoCulling)
CreateEntity(0, MeshID(0), MaterialID(0), 0, 0, -5)

Repeat
 
  Repeat
    ev = WindowEvent()
  Until  ev = 0
  RotateEntity(0, 0.2, 0.2, 0.2, #PB_Relative)
  RenderWorld()
 
  FlipBuffers()
  ExamineKeyboard()
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  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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