March 08, 2021, 04:17:56 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 - Maths
»
[bb] DeltaRoll by Stevie G [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] DeltaRoll by Stevie G [ 1+ years ago ] (Read 607 times)
BlitzBot
Jr. Member
Posts: 1
[bb] DeltaRoll by Stevie G [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:41 AM »
Title :
DeltaRoll
Author :
Stevie G
Posted :
1+ years ago
Description :
Returns the roll angle between two entities
Code :
Code: BlitzBasic
Graphics3D
640
,
480
,
16
,
1
Global
Camera =
CreateCamera
(
)
:
PositionEntity
Camera,
0
,
0
, -
30
Global
Ship =
CreateCone
(
)
:
ScaleMesh
Ship,
1
,
2
,
1
:
EntityColor
Ship,
0
,
0
,
255
Global
Target =
CreateCube
(
)
:
EntityColor
Target,
255
,
0
,
0
Repeat
If
KeyHit
(
57
)
PositionEntity
target,
Rand
(
-
20
,
20
)
,
Rand
(
-
20
,
20
)
,
10
EndIf
DR# = DELTAroll
(
Ship, Target
)
TurnEntity
ship,
0
,
0
, DR * .01
RenderWorld
(
)
Text
0
,
0
,DR
Flip
Until
KeyDown
(
1
)
;=================================================================================
;=================================================================================
;=================================================================================
Function
DELTAroll#
(
Source , Target
)
TFormPoint
0
,
0
,
0
, Target, Source
Return
VectorYaw
(
TFormedX
(
)
,
0
,
TFormedY
(
)
)
End Function
Comments :
Santiworld(Posted 1+ years ago)
in 3D only need 2 or 3 angles?i make missiles, and use deltayaw & deltapitch..is the same concept, no?
Stevie G(Posted 1+ years ago)
It is the same concept as deltayaw. I only wrote it cos someone asked me to but it's useful if your doing a 2d in 3d game using just the x + y axis instead of x + z axis. I use it myself for this purpose.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Maths
»
[bb] DeltaRoll by Stevie G [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal