[3D Programming] Text3D not works, Error Found!

Just starting out? Need help? Post your questions and find answers here.
User avatar
JamieVanCadsand
User
User
Posts: 34
Joined: Sun Jun 24, 2018 12:28 pm
Location: Holland

[3D Programming] Text3D not works, Error Found!

Post by JamieVanCadsand »

Hey 3D Game Programmers and Software Developers...

This is an first test to learn draw text in 3d, but if i run my script, i get an error...
So this is my script, written in PB 5.6.2, on Windows XP

Text3D, written in PB 5.6.2, Windows XP

Code: Select all

;****************************************************************************************************************
;Text3D
;****************************************************************************************************************

;Initializing
If InitEngine3D() = 0
  MessageRequester("Fatal Error", "Failed to Initialize Engine3D.dll", #PB_MessageRequester_Error)
  End
EndIf

If InitSprite() = 0
  MessageRequester("Fatal Error", "Failed to Initialize Sprites", #PB_MessageRequester_Error)
  End
EndIf

If InitKeyboard() = 0
  MessageRequester("Fatal Error", "Failed to Initialize Keyboard", #PB_MessageRequester_Error)
  End
EndIf

If OpenScreen(640, 480, 32, "", #PB_Screen_NoSynchronization) = 0
  MessageRequester("Fatal Error", "Failed to Open Screen", #PB_MessageRequester_Error)
  End
EndIf


;Call Variables and Enummerates
Declare Start3DWorld()

Global NewMap Blocks.i()
Global Time.i = 4

Enumeration
  #Light_Dir
  #Light_Point1
  #Light_Point2
  
  #Player
  
  #tEntity
  #tMesh
  #tTexture
  #tMaterial
EndEnumeration

;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************



;Starts 3D
Procedure Start3DWorld()
  
  CreateLight(#Light_Dir, RGB(255, 255, 200), 0, 0, 0, #PB_Light_Directional)
  CreateLight(#Light_Point1, RGB(255, 100, 100), 2, 1, 2, #PB_Light_Point)
  CreateLight(#Light_Point2, RGB(100, 255, 255), -2, -1, -2, #PB_Light_Point)
  
  CreateCamera(#Player, 0, 0, 100, 100)
  MoveCamera(#Player, 0, 0, 100)
  RotateCamera(#Player, 0, 0, 100, #PB_Relative)
  
  CreateTexture(#tTexture, 128, 128)
  StartDrawing(TextureOutput(#tTexture))
  For I = 0 To 128 Step 12
    Box(0, 0, 128, 128, RGB(255, 255, 0))
    Circle(I, I, 9, RGB(0, 0, 255))
  Next I
  
  CreateMaterial(#tMaterial, TextureID(#tTexture))
  
  CreateText3D(#tMesh, "Jamie van Cadsand")
  Text3DColor(#tMesh, RGB(255, 255, 255))
  Text3DAlignment(#tMesh, #PB_Text3D_HorizontallyCentered)
  MoveText3D(#tMesh, 0, 0, 0, #PB_Absolute)
  
  CreateEntity(#tEntity, MeshID(#tMesh), MaterialID(#tMaterial))
  
EndProcedure

;Render3D World and ask if player will be Exit this Program
Start3DWorld()
Repeat
  
  ExamineKeyboard()
  RenderWorld()
  FlipBuffers()
  ClearScreen(0)
  
  ExamineKeyboard()
  If KeyboardPushed(#PB_Key_0)
    DeleteMapElement(Blocks(), "Cube")
  EndIf
  
  If KeyboardPushed(#PB_Key_Escape)
    End
  EndIf
  
ForEver

;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;END Program
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************
;****************************************************************************************************************

This is my error:
[09:51:22] [COMPILER] Line 76: Constant not found: #Material.
[09:51:42] Waiting for executable to start...
[09:51:42] Executable type: Windows - x86 (32bit, Unicode)
[09:51:42] Executable started.
[09:51:51] [ERROR] Test3D.pb (Line: 77)
[09:51:51] [ERROR] The specified 'Texture' is null.
[09:51:55] The Program was killed.
[09:54:21] [COMPILER] Line 77: Constant not found: #Texture.
[09:54:36] Waiting for executable to start...
[09:54:36] Executable type: Windows - x86 (32bit, Unicode)
[09:54:36] Executable started.
[09:54:47] The Program execution has finished.
[09:55:21] Waiting for executable to start...
[09:55:21] Executable type: Windows - x86 (32bit, Unicode)
[09:55:21] Executable started.
[09:55:30] The Program execution has finished.
[09:55:48] Waiting for executable to start...
[09:55:48] Executable type: Windows - x86 (32bit, Unicode)
[09:55:48] Executable started.
[09:56:04] The Program execution has finished.
[09:56:16] Waiting for executable to start...
[09:56:16] Executable type: Windows - x86 (32bit, Unicode)
[09:56:16] Executable started.
[09:56:40] The Program execution has finished.
[09:57:40] Waiting for executable to start...
[09:57:40] Executable type: Windows - x86 (32bit, Unicode)
[09:57:40] Executable started.
[09:57:52] The Program execution has finished.
[09:58:12] Waiting for executable to start...
[09:58:12] Executable type: Windows - x86 (32bit, Unicode)
[09:58:12] Executable started.
[09:58:17] The Program execution has finished.
[09:58:30] Waiting for executable to start...
[09:58:30] Executable type: Windows - x86 (32bit, Unicode)
[09:58:30] Executable started.
[09:58:40] The Program execution has finished.
[09:59:20] Waiting for executable to start...
[09:59:20] Executable type: Windows - x86 (32bit, Unicode)
[09:59:20] Executable started.
[09:59:28] The Program execution has finished.
[09:59:37] Waiting for executable to start...
[09:59:38] Executable type: Windows - x86 (32bit, Unicode)
[09:59:38] Executable started.
[09:59:43] The Program execution has finished.
[09:59:51] Waiting for executable to start...
[09:59:51] Executable type: Windows - x86 (32bit, Unicode)
[09:59:51] Executable started.
[09:59:59] The Program execution has finished.
[10:02:59] Waiting for executable to start...
[10:02:59] Executable type: Windows - x86 (32bit, Unicode)
[10:02:59] Executable started.
[10:03:13] The Program execution has finished.
[10:04:08] Waiting for executable to start...
[10:04:08] Executable type: Windows - x86 (32bit, Unicode)
[10:04:08] Executable started.
[10:04:28] The Program was killed.
[10:05:15] Waiting for executable to start...
[10:05:15] Executable type: Windows - x86 (32bit, Unicode)
[10:05:15] Executable started.
[10:05:26] The Program execution has finished.
[10:07:27] Waiting for executable to start...
[10:07:27] Executable type: Windows - x86 (32bit, Unicode)
[10:07:27] Executable started.
[10:07:34] The Program execution has finished.
[10:08:42] Waiting for executable to start...
[10:08:42] Executable type: Windows - x86 (32bit, Unicode)
[10:08:42] Executable started.
[10:08:47] The Program execution has finished.
[10:09:28] Waiting for executable to start...
[10:09:28] Executable type: Windows - x86 (32bit, Unicode)
[10:09:28] Executable started.
[10:09:34] The Program execution has finished.
[10:12:48] Waiting for executable to start...
[10:12:48] Executable type: Windows - x86 (32bit, Unicode)
[10:12:48] Executable started.
[10:12:52] The Program execution has finished.
[10:25:54] [COMPILER] Line 98: CreateEntiry() is not a function, array, list, map or macro.
[10:26:53] [COMPILER] Line 100: Constant not found: #Entity.
[10:27:12] [COMPILER] Line 99: Constant not found: #Entity.
[10:27:24] Waiting for executable to start...
[10:27:24] Executable type: Windows - x86 (32bit, Unicode)
[10:27:24] Executable started.
[10:27:29] The Program execution has finished.
[10:38:02] [COMPILER] Line 117: Syntax error.
[10:38:18] Waiting for executable to start...
[10:38:18] Executable type: Windows - x86 (32bit, Unicode)
[10:38:18] Executable started.
[10:38:21] [ERROR] Test3D.pb (Line: 114)
[10:38:21] [ERROR] The specified #Text3D is not initialised.
[10:38:24] The Program was killed.
[10:39:27] Waiting for executable to start...
[10:39:27] Executable type: Windows - x86 (32bit, Unicode)
[10:39:27] Executable started.
[10:39:29] [ERROR] Test3D.pb (Line: 115)
[10:39:29] [ERROR] The specified #Text3D is not initialised.
[10:39:33] The Program was killed.
[10:41:58] Waiting for executable to start...
[10:41:58] Executable type: Windows - x86 (32bit, Unicode)
[10:41:58] Executable started.
[10:42:01] [ERROR] Test3D.pb (Line: 115)
[10:42:01] [ERROR] The specified #Text3D is not initialised.
[10:42:04] The Program was killed.
[10:42:29] Waiting for executable to start...
[10:42:29] Executable type: Windows - x86 (32bit, Unicode)
[10:42:29] Executable started.
[10:42:32] [ERROR] Test3D.pb (Line: 98)
[10:42:32] [ERROR] The specified #Text3D is not initialised.
[10:42:34] The Program was killed.
[10:44:21] Waiting for executable to start...
[10:44:21] Executable type: Windows - x86 (32bit, Unicode)
[10:44:21] Executable started.
[10:44:23] [ERROR] Test3D.pb (Line: 96)
[10:44:23] [ERROR] The specified #Texture is not initialised.
[10:44:26] The Program was killed.
[10:45:31] Waiting for executable to start...
[10:45:31] Executable type: Windows - x86 (32bit, Unicode)
[10:45:31] Executable started.
[10:45:34] [ERROR] Test3D.pb (Line: 98)
[10:45:34] [ERROR] The specified #Text3D is not initialised.
[10:45:37] The Program was killed.
[10:48:45] Waiting for executable to start...
[10:48:45] Executable type: Windows - x86 (32bit, Unicode)
[10:48:45] Executable started.
[10:48:47] [ERROR] Test3D.pb (Line: 109)
[10:48:47] [ERROR] The specified #Text3D is not initialised.
[10:48:50] The Program was killed.
[10:49:31] Waiting for executable to start...
[10:49:31] Executable type: Windows - x86 (32bit, Unicode)
[10:49:31] Executable started.
[10:49:33] [ERROR] Test3D.pb (Line: 109)
[10:49:33] [ERROR] The specified #Text3D is not initialised.
[10:49:37] The Program was killed.
[10:51:14] Waiting for executable to start...
[10:51:14] Executable type: Windows - x86 (32bit, Unicode)
[10:51:14] Executable started.
[10:51:16] [ERROR] Test3D.pb (Line: 109)
[10:51:16] [ERROR] The specified #Text3D is not initialised.
[10:51:20] The Program was killed.
[10:55:09] Waiting for executable to start...
[10:55:09] Executable type: Windows - x86 (32bit, Unicode)
[10:55:09] Executable started.
[10:55:13] [ERROR] Test3D.pb (Line: 95)
[10:55:13] [ERROR] The specified #Text3D is not initialised.
[10:55:16] The Program was killed.

Just it said thad the specified #Text3D is not initialized...


I can't find the problem..., just run this script and see whats wrong with this, if you can find the problem...,
pleace correct my code and post is on this topic pleace...

Thanks for help, Jamie.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: [3D Programming] Text3D not works, Error Found!

Post by DK_PETER »

Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Post Reply