I'm noob in PB.
http://stalkerfangroup.ru/Stalker_2/terrain_bugs.jpg
What is it and how can I fix it?
Thanks!
Ok, thanks Fred.Fred wrote:You will need to post some code to get help.
Code: Select all
EnableWorldPhysics(1)
EnableWorldCollisions(1)
WorldShadows(#PB_Shadow_Modulative, 0, RGB(180, 180, 180))
MaterialFilteringMode(#PB_Default, #PB_Material_Anisotropic, 8)
SetupTerrains(LightID(Light), 3000, #PB_Terrain_NormalMapping)
CreateTerrain(0, 1025, 10000, 300, 5, "Workspace/terrain_entr", "Dat")
TerrainLocate(0, 5000, 0, 5000)
AddTerrainTexture(0, 0, 70, "grass_tile1.dds", "terrain_heightmap.dds")
AddTerrainTexture(0, 1, 50, "asphalt_tile1.jpg", "grass_green-01_normalheight.dds")
AddTerrainTexture(0, 2, 50, "asphalt_tile2.jpg", "grass_green-01_normalheight.dds")
AddTerrainTexture(0, 3, 50, "grnd_tile1.dds", "grass_green-01_normalheight.dds")
AddTerrainTexture(0, 4, 50, "scale512.png", "grass_green-01_normalheight.dds")
DefineTerrainTile(0, 0, 0, "terrain513.png", 0, 0)
BuildTerrain(0)
UpdateTerrain(0)
SaveTerrain(0, #False)
TerrainRenderMode(0, #PB_Terrain_CastShadows)
TerrainPhysicBody(0, 0.2, 0.2)
I don't think you can in PB. Negative values are not allowed and will produce an "'Assertion Failed!'".Lexicon wrote:I want to create a sky via place a sphere. But I need to texturing inside this mesh.
you can use SkyDome() , or use MaterialCullingMode() :Lexicon wrote:And another question...![]()
What function will flipping mesh like FlipMesh from Blitz3D? Or how can I do it in PB?
I want to create a sky via place a sphere. But I need to texturing inside this mesh.
Thanks.
Code: Select all
;Sky
CreateMaterial(2, LoadTexture(2, "DosCarte.png"))
MaterialCullingMode(2, #PB_Material_AntiClockWiseCull)
CreateSphere(2, 350)
CreateEntity(2, MeshID(2), MaterialID(2))Code: Select all
MaterialCullingMode(2, #PB_Material_NoCulling)Code: Select all
;
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY, SpriteX, SpriteY
Global Dim MeshDataVertex.PB_MeshVertex(0)
Global Dim MeshDataIndex.PB_MeshFace(0)
If InitEngine3D()
Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Models", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Scripts", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Packs/Desert.zip", #PB_3DArchive_Zip)
Parse3DScripts()
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
;- Ground
;
CreateMaterial(0, LoadTexture(0, "Dirt.jpg"))
CreatePlane(0, 1500, 1500, 40, 40, 15, 15)
CreateEntity(0,MeshID(0),MaterialID(0))
EntityRenderMode(0, 0)
CreateCube(1, 50)
CreateEntity(1, MeshID(1), GetScriptMaterial(1, "Color/Blue"), 0, 50, 0)
;Sky
CreateMaterial(2, LoadTexture(2, "DosCarte.png"))
MaterialCullingMode(2, #PB_Material_AntiClockWiseCull)
CreateSphere(2, 600)
CreateEntity(2, MeshID(2), MaterialID(2), 0, 300, 0)
;- Camera
;
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 120, 500, #PB_Absolute)
CameraBackColor(0, $FF)
;- Light
;
CreateLight(0, RGB(255, 255, 255), -40, 100, 80)
AmbientColor(RGB(80, 80, 80))
Repeat
Screen3DEvents()
If ExamineMouse()
MouseX = -MouseDeltaX()/10
MouseY = -MouseDeltaY()/10
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -1
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = 1
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -1
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = 1
Else
KeyY = 0
EndIf
EndIf
RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
EndWhere are your specifics questions ?DK_PETER wrote:And yeah...This and my 3D Specifics questions should be in the 3D section too.
Code: Select all
CreateMesh(11, #PB_Mesh_TriangleList, #PB_Mesh_Dynamic)
MeshVertexPosition(0, 0, 0)
MeshVertexTextureCoordinate(0, 1)
MeshVertexPosition(0, 5000, 0)
MeshVertexTextureCoordinate(0, 0)
MeshVertexPosition(5000, 5000, 0)
MeshVertexTextureCoordinate(1, 0)
MeshVertexPosition(5000, 0, 0)
MeshVertexTextureCoordinate(1, 1)
MeshFace(0, 1, 2)
MeshFace(0, 3, 2)
FinishMesh(#False)
NormalizeMesh(11)
CreateNode(11)
AttachNodeObject(11, MeshID(11))
ScaleNode(11, 1, 1, 1)
CreateMaterial(11, LoadTexture(11, "sky_up.dds"))
DisableMaterialLighting(11, #True)
MaterialShadingMode(11, #PB_Material_Solid)
MaterialCullingMode(11, #PB_Material_NoCulling)
SetMeshMaterial(11, MaterialID(11), 0)
Result = CreateEntity(11, MeshID(11), MaterialID(11))
Code: Select all
;
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY, SpriteX, SpriteY
Global Dim MeshDataVertex.PB_MeshVertex(0)
Global Dim MeshDataIndex.PB_MeshFace(0)
If InitEngine3D()
Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Models", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Scripts", #PB_3DArchive_FileSystem)
Add3DArchive("Data/Packs/Desert.zip", #PB_3DArchive_Zip)
Parse3DScripts()
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
;- Ground
;
CreateMaterial(0, LoadTexture(0, "Dirt.jpg"))
CreatePlane(0, 1500, 1500, 40, 40, 15, 15)
CreateEntity(0,MeshID(0),MaterialID(0))
EntityRenderMode(0, 0)
CreateCube(1, 50)
CreateEntity(1, MeshID(1), GetScriptMaterial(1, "Color/Blue"), 0, 50, 0)
;Sky
CreateMaterial(2, LoadTexture(2, "DosCarte.png"))
CreateMaterial(3, LoadTexture(3, "Geebee2.bmp"))
MaterialCullingMode(2, #PB_Material_NoCulling )
MaterialCullingMode(3, #PB_Material_NoCulling )
CreateSphere(2, 600)
CreateEntity(2, MeshID(2), MaterialID(2), 0, 300, 0)
CreateSphere(3, 610)
CreateEntity(3, MeshID(3), MaterialID(3), 0, 300, 0)
;- Camera
;
CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 120, 500, #PB_Absolute)
CameraBackColor(0, $FF)
;- Light
;
CreateLight(0, RGB(255, 255, 255), -40, 100, 80)
AmbientColor(RGB(80, 80, 80))
Repeat
Screen3DEvents()
If ExamineMouse()
MouseX = -MouseDeltaX()/10
MouseY = -MouseDeltaY()/10
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -10
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = 10
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -10
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = 10
Else
KeyY = 0
EndIf
EndIf
RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End