We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D Programming in SB
#9
Just This Is My hardest Topic For Learning 3D World Of SB The Coordinates X,Y,Z In The 3D World I Got The Image From Litdev's Give Link About WPF 3D World.
   

How Easy 2D World Was Only Two Coordinates X,Y We Could Draw Shapes So Easily.
But 3D World Is Really Hard For Beginners Like Me Sad
So I Gone To ChatGPT For Some Understanding.

[*]2D Coordinate System:
  • Origin: Located at the upper-left corner of the rendering area (typically the screen).
  • Axes Orientation:
    • X-axis: Positive values extend to the right.
    • Y-axis: Positive values extend downward.
[*]3D Coordinate System:
  • Origin: Located at the center of the rendering area.
  • Axes Orientation:
    • X-axis: Positive values extend to the right.
    • Y-axis: Positive values extend upward.
    • Z-axis: Positive values extend outward from the origin, towards the viewer.
Then I Open SB And Made Following Code:
Code:
GraphicsWindow.BackgroundColor = "LightBlue"
view = LD3DView.AddView(GraphicsWindow.Width,GraphicsWindow.Height,"True")
Point_A = "0 0 0"
Point_B = "2 0 0"
Point_C = "2 3 0"
Point_D = "0 3 0"
all = Point_A + ":" + Point_B + ":" + Point_C + ":" + Point_D
obj = LD3DView.AddGeometry(view,all,"","","Red","E")
I Tested Looked Like A 2D Right Angle Triangle.
Added Following Code Segment From Litdev Sample For Rotating Camera.
The Final Code:
Code:
GraphicsWindow.BackgroundColor = "LightBlue"
view = LD3DView.AddView(GraphicsWindow.Width,GraphicsWindow.Height,"True")
Point_A = "0 0 0"
Point_B = "2 0 0"
Point_C = "2 3 0"
Point_D = "0 3 0"
all = Point_A + ":" + Point_B + ":" + Point_C + ":" + Point_D
obj = LD3DView.AddGeometry(view,all,"","","Red","E")
While ("True")
  'Use the keys to move the camera
  yaw = 0
  pitch = 0
  roll = 0
  move = 0
  If (LDUtilities.KeyDown("Left")) Then
    yaw = yaw-1
  EndIf
  If (LDUtilities.KeyDown("Right")) Then
    yaw = yaw+1
  EndIf
  If (LDUtilities.KeyDown("Up")) Then
    pitch = pitch-1
  EndIf
  If (LDUtilities.KeyDown("Down")) Then
    pitch = pitch+1
  EndIf
  If (LDUtilities.KeyDown("A")) Then
    roll = roll+1
  EndIf
  If (LDUtilities.KeyDown("D")) Then
    roll = roll-1
  EndIf
  If (LDUtilities.KeyDown("W")) Then
    move = move+1
  EndIf
  If (LDUtilities.KeyDown("S")) Then
    move = move-1
  EndIf
 
  LD3DView.MoveCamera(view,yaw,pitch,roll,move) 'These are relative changes wrt current view
  Program.Delay(10)
EndWhile
Import ID : ZBQM826.000
Now I Am Having Fun By Changing X Y Z Point's In Code.

   


Smile
ZS
[-] The following 3 users Like z-s's post:
  • AbsoluteBeginner, litdev, stevantosic
Reply


Messages In This Thread
3D Programming in SB - by litdev - 07-08-2024, 09:29 AM
RE: 3D Programming in SB - by AbsoluteBeginner - 07-08-2024, 02:05 PM
RE: 3D Programming in SB - by z-s - 07-08-2024, 03:52 PM
RE: 3D Programming in SB - by litdev - 07-08-2024, 04:08 PM
RE: 3D Programming in SB - by AbsoluteBeginner - 07-10-2024, 08:03 AM
RE: 3D Programming in SB - by litdev - 07-10-2024, 08:39 AM
RE: 3D Programming in SB - by z-s - 07-10-2024, 09:39 AM
RE: 3D Programming in SB - by litdev - 07-10-2024, 10:02 AM
RE: 3D Programming in SB - by z-s - 07-10-2024, 10:12 AM
RE: 3D Programming in SB - by AbsoluteBeginner - 07-10-2024, 10:16 AM
RE: 3D Programming in SB - by z-s - 07-10-2024, 10:16 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)