every body must be pivatnode the helicopter.

now it works.

Texture : rot.png blau.png and has yet to be created.

gruss

Code: Select all

#include "IrrlichtWrapper.bi"

Dim Mesh As irr_mesh

Dim MeshTexture As irr_texture

Dim OurCamera As irr_camera

Dim CentreNode As irr_node

Dim EdgeNode1 As irr_node

Dim EdgeNode2 As irr_node

Dim PivotNode As irr_node

Dim PivotNode1 As irr_node

Dim PivotNode2 As irr_node

Dim CentreNode0 As irr_node

Dim EdgeNode10 As irr_node

Dim EdgeNode20 As irr_node

Dim PivotNode0 As irr_node

Dim PivotNode10 As irr_node

Dim PivotNode20 As irr_node

Dim CentreNode1 As irr_node

Dim PivotNode30 As irr_node

Dim CubeRotation As Double

IrrStart( IRR_EDT_OPENGL, 512, 512, IRR_BITS_PER_PIXEL_32, _

IRR_WINDOWED, IRR_NO_SHADOWS, IRR_IGNORE_EVENTS )

IrrSetWindowCaption( "quadro" )

'--------------------------------------------------------

PivotNode = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode, 0.0, 0.0, 0.0 )

CentreNode = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/rot.png")

IrrSetNodeMaterialTexture( CentreNode, MeshTexture, 0)

IrrSetNodeScale( CentreNode, 1.8,0.03,0.03 )

IrrAddChildToParent(CentreNode, PivotNode)

PivotNode1 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode1, 0.0, 0.0, 0.0 )

EdgeNode1 = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/blau.png")

IrrSetNodeMaterialTexture( EdgeNode1, MeshTexture, 0 )

IrrSetNodeScale( EdgeNode1, 0.5,0.01, 0.04)

IrrAddChildToParent(EdgeNode1, PivotNode1)

PivotNode2 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode2, 0.0, 0.0, 0.0 )

EdgeNode2 = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/blau.png")

IrrSetNodeMaterialTexture( EdgeNode2, MeshTexture, 0 )

IrrSetNodeScale( EdgeNode2, 0.5,0.01, 0.04)

IrrAddChildToParent(EdgeNode2, PivotNode2)

IrrAddChildToParent(PivotNode1,PivotNode )

IrrSetNodePosition( PivotNode1, 8.8, 0.4, 0.0)

IrrAddChildToParent(PivotNode2,PivotNode )

IrrSetNodePosition( PivotNode2, -8.8, 0.4, 0.0)

'-------------------------------------------------------

PivotNode0 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode0, 0.0, 0.0, 0.0 )

CentreNode0 = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/rot.png")

IrrSetNodeMaterialTexture( CentreNode0, MeshTexture, 0 )

IrrSetNodeScale( CentreNode0, 1.8,0.03,0.03 )

IrrAddChildToParent(CentreNode0, PivotNode0)

PivotNode10 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode10, 0.0, 0.0, 0.0 )

EdgeNode10 = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/blau.png")

IrrSetNodeMaterialTexture( EdgeNode10, MeshTexture, 0 )

IrrSetNodeScale( EdgeNode10, 0.5,0.01, 0.04)

IrrAddChildToParent(EdgeNode10, PivotNode10)

PivotNode20 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode20, 0.0, 0.0, 0.0 )

EdgeNode20 = IrrAddTestSceneNode

MeshTexture = IrrGetTexture("./media/blau.png")

IrrSetNodeMaterialTexture( EdgeNode20, MeshTexture, 0 )

IrrSetNodeScale( EdgeNode20, 0.5,0.01, 0.04)

IrrAddChildToParent(EdgeNode20, PivotNode20)

IrrAddChildToParent(PivotNode10,PivotNode0 )

IrrSetNodePosition( PivotNode10, 8.8, 0.4, 0.0)

IrrAddChildToParent(PivotNode20,PivotNode0 )

IrrSetNodePosition( PivotNode20, -8.8, 0.4, 0.0)

'-------------------------------------------------------

PivotNode30 = IrrAddEmptySceneNode

IrrSetNodePosition( PivotNode30, 0.0, 0.0, 0.0 )

CentreNode1 = IrrAddSphereSceneNode( 1.0, 16 )

MeshTexture = IrrGetTexture("./media/gruen.png")

IrrSetNodeMaterialTexture( CentreNode1, MeshTexture, 0)

IrrAddChildToParent(CentreNode1, PivotNode30)

'-------------------------------------------------------

IrrAddChildToParent(PivotNode0,PivotNode )

IrrSetNodePosition( PivotNode0, 0.0,0.0, 0.0)

IrrSetNodeRotation( PivotNode0, 0.0, 90.0, 0.0)

IrrAddChildToParent(PivotNode30,PivotNode )

IrrSetNodePosition( PivotNode30, 0.0,0.0, 0.0)

IrrSetAmbientLight( 1,1,1 )

OurCamera = IrrAddCamera( 10,20,20, 0,0,0 )

While IrrRunning

IrrBeginScene( 200,200,200 )

CubeRotation = Timer * 100

irrSetNodeRotation( PivotNode, 0.0,0.0,CubeRotation/4 )

IrrSetNodeRotation( PivotNode1, 0.0, CubeRotation, 0.0)

IrrSetNodeRotation( PivotNode2, 0.0, CubeRotation, 0.0)

IrrSetNodeRotation( PivotNode10, 0.0, CubeRotation, 0.0)

IrrSetNodeRotation( PivotNode20, 0.0, CubeRotation, 0.0)

IrrDrawScene

IrrEndScene

Wend

IrrStop