January 20, 2021, 01:44:25 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] Simpler TForm 3D Radar by _PJ_ [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Simpler TForm 3D Radar by _PJ_ [ 1+ years ago ] (Read 572 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Simpler TForm 3D Radar by _PJ_ [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:41 AM »
Title :
Simpler TForm 3D Radar
Author :
_PJ_
Posted :
1+ years ago
Description :
As per 'Elite' radar - thanks to Klaas, skidracer & Stevie G
Code :
Code: BlitzBasic
Graphics3D
800
,
600
,
32
,
0
SetBuffer
BackBuffer
(
)
lighting=
CreateLight
(
2
)
PositionEntity
lighting,-
20
,
20
,-
30
ship=
CreateCone
(
3
,
1
)
ScaleMesh
ship,
2
,
5
,
1
RotateMesh
ship,-
90
,
180
,
0
red=
CreateCube
(
)
blue=
CreateCube
(
)
green=
CreateCube
(
)
EntityColor
red,
255
,
0
,
0
EntityColor
green,
0
,
255
,
0
EntityColor
blue,
0
,
0
,
255
cam=
CreateCamera
(
)
MoveEntity
cam,
0
,
0
,-
20
PointEntity
cam,ship
PositionEntity
red,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
PositionEntity
blue,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
PositionEntity
green,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
,
Rand
(
-
10
,
10
)
While
Not
KeyDown
(
1
)
If
KeyDown
(
208
)
Then
TurnEntity
ship,
5
,
0
,
0
If
KeyDown
(
200
)
Then
TurnEntity
ship,-
5
,
0
,
0
If
KeyDown
(
203
)
Then
TurnEntity
ship,
0
,
5
,
0
If
KeyDown
(
205
)
Then
TurnEntity
ship,
0
,-
5
,
0
If
MouseDown
(
1
)
MoveEntity
ship,
0
,
0
,
1
UpdateWorld
RenderWorld
;Radar
Color
255
,
255
,
255
Rect
400
,
500
,
3
,
3
,
0
;Red Dot
TFormPoint
(
EntityX
(
red
)
,
EntityY
(
red
)
,
EntityZ
(
red
)
,
0
,ship
)
red_relativeX=
(
0
-
TFormedX
(
)
)
red_relativey=
TFormedY
(
)
red_relativez=
TFormedZ
(
)
Color
255
,
0
,
0
If
red_relativeY>
0
Then
Rect
400
-red_relativeX,
500
-red_relativeZ,
1
,red_relativeY,
1
If
red_relativeY<
0
Then
Rect
400
-red_relativeX,
500
-red_relativeZ+
Abs
(
red_relativeY
)
,
1
,
Abs
(
red_relativeY
)
,
1
;Green Dot
TFormPoint
(
EntityX
(
green
)
,
EntityY
(
green
)
,
EntityZ
(
green
)
,
0
,ship
)
green_relativeX=
(
0
-
TFormedX
(
)
)
green_relativey=
TFormedY
(
)
green_relativez=
TFormedZ
(
)
Color
0
,
255
,
0
If
green_relativeY>
0
Then
Rect
400
-green_relativeX,
500
-green_relativeZ,
1
,green_relativeY,
1
If
green_relativeY<
0
Then
Rect
400
-green_relativeX,
500
-green_relativeZ+
Abs
(
green_relativeY
)
,
1
,
Abs
(
green_relativeY
)
,
1
;Blue Dot
TFormPoint
(
EntityX
(
blue
)
,
EntityY
(
blue
)
,
EntityZ
(
blue
)
,
0
,ship
)
blue_relativeX=
(
0
-
TFormedX
(
)
)
blue_relativey=
TFormedY
(
)
blue_relativez=
TFormedZ
(
)
Color
0
,
0
,
255
If
blue_relativeY>
0
Then
Rect
400
-blue_relativeX,
500
-blue_relativeZ,
1
,blue_relativeY+
1
,
1
If
blue_relativeY<
0
Then
Rect
400
-blue_relativeX,
500
-blue_relativeZ+
Abs
(
blue_relativeY
)
,
1
,
Abs
(
blue_relativeY
)
,
1
Flip
Wend
End
Comments :
Rook Zimbabwe(Posted 1+ years ago)
I was racking my pitiful brain trying to come up with a way to do this!
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] Simpler TForm 3D Radar by _PJ_ [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal