January 19, 2021, 06:08:31 AM
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] Simple Entity Parent by Blitzplotter [ 1 day ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Simple Entity Parent by Blitzplotter [ 1 day ago ] (Read 638 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Simple Entity Parent by Blitzplotter [ 1 day ago ]
«
on:
June 29, 2017, 12:28:40 AM »
Title :
Simple Entity Parent
Author :
Blitzplotter
Posted :
1 day ago
Description :
6 cylinders parented, use the parent handle to rotate. The MGParent entity can be exported to an STL file using Tom Toads stl_exporter utility, link embedded in code.
Code :
Code: BlitzBasic
; entity_parent.bb
; Welding 6 cylinders and parenting them to a single entity
; By Blitzplotter - Jun 2017
; Successfull export of .STL can be tested by using blender
; Use TomToads STL Exporter File
; available here:
; https://www.blitzbasic.com/codearcs/codearcs.php?code=3271
Graphics3D
800
,
600
Dim
ARYcylinder
(
6
)
Global
MGparent=
CreateCylinder
(
)
For
x=
1
To
6
ARYcylinder
(
x
)
=
CreateCylinder
(
36
)
ScaleEntity
ARYcylinder
(
x
)
,
3
,
60
,
3
RotateEntity
ARYcylinder
(
x
)
,x*
45
,
0
,
0
;add each of the cylinders to a parent entity
EntityParent
ARYcylinder
(
x
)
,MGparent
Next
pivot=
CreatePivot
(
)
cam=
CreateCamera
(
pivot
)
PositionEntity
cam,
0
,
0
,-
100
lit=
CreateLight
(
)
RotateEntity
lit,
45
,
45
,
0
spin_this=
1
; Use TomToads STL Exporter File
; available here:
; https://www.blitzbasic.com/codearcs/codearcs.php?code=3271
;------------------------
Include
"./STL_Export.bb"
;------------------------
While
Not
KeyHit
(
1
)
RotateEntity
MGparent,
1
,spin_this,
0
UpdateWorld
(
)
RenderWorld
(
)
Flip
VWait
120
spin_this = spin_this +
1
Wend
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
3D Graphics - Effects
»
[bb] Simple Entity Parent by Blitzplotter [ 1 day ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal