Re: >>>>> PB 6.20 -Bugs <<<<<
Posted: Thu Jan 30, 2025 2:03 pm
has not been fixed yet on Mac 

http://www.purebasic.com
https://www.purebasic.fr/english/
skinkairewalker wrote: Thu Dec 12, 2024 9:15 pm I will test some 3D examples on MacOS:
CarPhysics.pb = I can't change the numbers in the parameters next to it.
Character.pb = when moving the camera around the ogre, it seems that the camera or the 3d model starts to shake. (video below)
FacialAnimation.pb = Apparently it's ok
FPSFirstPerson = Line 86 [ERROR] The specified #Material is not initialised.
MaterialScripts.pb = Line: 522 [ERROR] The specified #Material is not initialised.
MeshManualFlag.pb = Apparently it's ok
MeshManualParametrics.pb = Apparently it's ok
MeshMorphing.pb Line: 43 [ERROR] The specified #Material is not initialised.
Pinball.pb = Apparently it's ok
Tank.pb = Apparently it's ok
ThirdyPerson.pb = I don't know what's going on... the character leans to the side as if physics impacted him (screenshot below)
Video Character.pb : https://i.imgur.com/T0Lu0oF.mp4 or https://imgur.com/a/mFoxbkG
Screenshot ThirdyPerson.pb :![]()
Code: Select all
Add3DArchive("D:\myfolder",#PB_3DArchive_FileSystem)
Code: Select all
debug LoadMesh(#mallapis,"D:\myfolder\pis.mesh")
Code: Select all
debug LoadMesh(#mallapis,"pis.mesh")
Code: Select all
InitEngine3D(#PB_Engine3D_NoLog,#PB_Compiler_Home+"Compilers\Engine3d.dll")
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,800,600,"v",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,1,0,0,#PB_Screen_WaitSynchronization)
Add3DArchive(#PB_Compiler_Home+"examples\3D\Data\fonts",#PB_3DArchive_FileSystem)
Parse3DScripts()
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,10,#PB_Absolute)
CreateCube(0,1)
CreateEntity(0,MeshID(0),#PB_Material_None)
CreateEntity(1,MeshID(0),#PB_Material_None,4,0,0)
AttachEntityObject(0,"",EntityID(1))
CreateText3D(0,"hola","",0.4,$EEEEEEEE):MoveText3D(0,2,2,0,#PB_Absolute)
Text3DAlignment(0,#PB_Text3D_HorizontallyCentered|#PB_Text3D_VerticallyCentered)
CreateNode(0)
AttachNodeObject(0,Text3DID(0))
Repeat
Repeat:Eventodeventana.i=WindowEvent():Until Eventodeventana=0
ExamineKeyboard()
if KeyboardPushed(#PB_Key_right):RotateEntity(0,0,0,-1,#PB_Relative)
elseif KeyboardPushed(#PB_Key_left):RotateEntity(0,0,0,1,#PB_Relative)
endif
Text3DCaption(0,"Pos1: "+StrF(EntityX(1),2)+", "+StrF(EntityY(1),2)+", "+StrF(EntityZ(1),2)+#CRLF$+
"Dir1: "+StrF(EntityDirectionX(1),2)+", "+StrF(EntityDirectionY(1),2)+", "+StrF(EntityDirectionZ(1),2)+#CRLF$+
"Pos0: "+StrF(EntityX(0),2)+", "+StrF(EntityY(0),2)+", "+StrF(EntityZ(0),2)+#CRLF$+
"Dir0: "+StrF(EntityDirectionX(0),2)+", "+StrF(EntityDirectionY(0),2)+", "+StrF(EntityDirectionZ(0),2))
RenderWorld()
FlipBuffers():Delay(16)
Until KeyboardPushed(#PB_Key_Escape)
Code: Select all
if KeyboardPushed(#PB_Key_right):a.f+0.01:EntityDirection(0,Sin(a),Cos(a),0,#PB_World,#PB_Vector_NegativeZ)
elseif KeyboardPushed(#PB_Key_left):a.f-0.01:EntityDirection(0,Sin(a),Cos(a),0,#PB_World,#PB_Vector_NegativeZ)
Code: Select all
ExamineDesktops()
InitEngine3D(#PB_Engine3D_NoLog,#PB_Compiler_Home+"Compilers/Engine3d.dll")
InitSprite():InitKeyboard():InitMouse():InitSound()
OpenWindow(0,0,0,800,600,Titulo$,#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,1,0,0,#PB_Screen_WaitSynchronization)
Add3DArchive(#PB_Compiler_Home+"Examples/3D/Data/Textures",#PB_3DArchive_FileSystem)
Parse3DScripts()
CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,10,#PB_Absolute)
LoadTexture(0,"nvidia/dirt_grayrocky_diffusespecular.jpg"):CreateMaterial(0,TextureID(0))
CreateCube(0,2):TransformMesh(0,0,0,0,1,0.01,1,0,0,0,0):UpdateMeshBoundingBox(0)
CreateEntity(0,MeshID(0),MaterialID(0),0,-1.25,0)
Repeat:While WindowEvent()<>#PB_Event_None:Wend
ExamineMouse():ExamineKeyboard()
TimeSinceLastFrame.i=RenderWorld(50)
FlipBuffers():Delay(9)
Until KeyboardPushed(#PB_Key_Escape)
Code: Select all
;-CONSTANTS
#MAINDESKTOP_H = 0
#WINDOW_H = 0
#WINDOW_WIDTH = 1366
#WINDOW_HEIGHT = 768
#WINDOW_FLAGS = #PB_Window_Invisible|#PB_Window_BorderLess|#PB_Window_ScreenCentered
#MAINLOOP_DELAY = 1
#COMPILER_MINIMUM_VERSION = 620
#ANTIALIASING_MODE = #PB_AntialiasingMode_x4
;->GLOBALS
Global MAINCAMERA_3D.i
Global spr_stripe.i
;-AUXILIARY PROCEDURES
Procedure sub_checks()
If Int(#PB_Compiler_Version) < #COMPILER_MINIMUM_VERSION
Debug "Please compile with the currently newest beta 6.20."
End
EndIf
EndProcedure
;-AUXILIARY PROCEDURES 2D
Procedure createstripesprite()
Protected img_stripe.i
img_stripe=CreateImage(#PB_Any,128,128,24,RGBA(1,1,1,255))
StartVectorDrawing(ImageVectorOutput(img_stripe))
MovePathCursor(0,128)
AddPathLine(64,0)
AddPathLine(128,0)
AddPathLine(64,128)
ClosePath()
VectorSourceColor(RGBA(255,255,0,255))
FillPath()
StopVectorDrawing()
spr_stripe.i=CreateSprite(#PB_Any,128,128)
StartDrawing(SpriteOutput(spr_stripe))
DrawImage(ImageID(img_stripe),0,0)
StopDrawing()
FreeImage(img_stripe)
EndProcedure
;-AUXILIARY PROCEDURES 3D
Procedure sub_createbasicworld()
Protected planemesh.i, cubemesh.i
Protected planeentity.i, cubeentity.i
Protected texture_A.i,texture_B.i
Protected material_A.i,material_B.i
texture_A=CreateTexture(#PB_Any,256,256)
StartDrawing(TextureOutput(texture_A))
Box(0,0,256,256,RGB(10,128,10))
For x = 1 To 4096
Plot(Random(255),Random(255),RGB(Random(25),100+Random(50),Random(25)))
Next x
StopDrawing()
material_A.i = CreateMaterial(#PB_Any,TextureID(texture_A))
ScaleMaterial(material_A,0.25,0.25)
texture_B=CreateTexture(#PB_Any,256,256)
StartDrawing(TextureOutput(texture_B))
Box(0,0,256,256,RGB(188,188,188))
For x = 0 To 4096
Plot(Random(255),Random(255),RGB(150+Random(25),150+Random(25),150+Random(25)))
Next x
Box(0,0,256,10,RGB(88,88,88))
Box(0,0,10,256,RGB(88,88,88))
Box(246,0,256,256,RGB(88,88,88))
Box(0,246,256,256,RGB(88,88,88))
StopDrawing()
material_B.i = CreateMaterial(#PB_Any,TextureID(texture_B))
planemesh=CreatePlane(#PB_Any,1000,1000,1,1,1,1)
cubemesh=CreateCube(#PB_Any,100)
planeentity=CreateEntity(#PB_Any,MeshID(planemesh),MaterialID(material_A),0,0,0)
cubeentity=CreateEntity(#PB_Any,MeshID(cubemesh),MaterialID(material_B),0,50,0)
RotateEntity(planeentity,0,180,0)
MoveCamera(MAINCAMERA_3D,0,10,-300)
CameraLookAt(MAINCAMERA_3D,EntityX(cubeentity),EntityY(cubeentity),EntityZ(cubeentity))
EndProcedure
;-PROCEDURES 3D
Procedure app3d_start()
sub_checks()
ExamineDesktops()
InitMouse()
InitKeyboard()
InitEngine3D()
AntialiasingMode(#ANTIALIASING_MODE)
InitSprite()
OpenWindow(#WINDOW_H,0,0,#WINDOW_WIDTH,#WINDOW_HEIGHT,"Viewport bug",#WINDOW_FLAGS)
OpenWindowedScreen(WindowID(#WINDOW_H),0,0,#WINDOW_WIDTH,#WINDOW_HEIGHT,1,0,0,#PB_Screen_WaitSynchronization)
createstripesprite()
MAINCAMERA_3D=CreateCamera(#PB_Any,0,0,100,100)
ResizeWindow(#WINDOW_H,0,0,DesktopWidth(#MAINDESKTOP_H),DesktopHeight(#MAINDESKTOP_H))
ResizeCamera(MAINCAMERA_3D,0,0,100,100)
HideWindow(#WINDOW_H,#False)
EndProcedure
Procedure app3d_update()
Delay(#MAINLOOP_DELAY)
Repeat : Until Not WindowEvent()
ExamineKeyboard()
ExamineMouse()
RenderWorld()
;-##### BUG - VIEWPORT SPRITE AUTOSTRETCH WINDOWED FULLSCREEN - BUG
If KeyboardPushed(#PB_Key_Space) : DisplaySprite(spr_stripe,0,0) :EndIf
If KeyboardPushed(#PB_Key_Return) : DisplaySprite(spr_stripe,0,0) :ResizeCamera(MAINCAMERA_3D,0,0,100,100):EndIf
;-##### BUG END
FlipBuffers()
EndProcedure
;-MAIN PROGRAM PROCEDURE
Procedure main3d()
app3d_start()
sub_createbasicworld()
Repeat
app3d_update()
Until KeyboardPushed(#PB_Key_Escape)
EndProcedure
;-MAIN PROGRAM
main3d()