Rotating a parental entity
Blitz3D Forums/Blitz3D Programming/Rotating a parental entity
| ||
Hi, cannot seem to rotate a parental entity. When I do I get memory access violation. Any thoughts... Graphics3D 800,600,32,2 ; Setup the apps title and close app caption AppTitle "CuBE v0.01", "Are you sure?" ;Create a parent cube... parent_cube = CreateCube ;HideEntity parent_cube ; Set the randomizer seed for more true random numbers SeedRnd (MilliSecs()) Type cube Field entity Field x# Field y# Field z# End Type ;Global alien=LoadMesh("alien.b3d") ;Make 50 objects For i=1 To 10 cube.cube = New cube cube\entity=CreateCube(parent_cube) ScaleEntity cube\entity, 0.5, 0.5, 0.5 EntityColor cube\entity, Rand(50, 255), Rand(50, 255), Rand(50, 255) cube\x#=i cube\y#=0 cube\z#=0 PositionEntity cube\entity,cube\x#,cube\y#,cube\z# Next camera = CreateCamera() light = CreateLight() PositionEntity camera,0,0,-20 PositionEntity light,-5,-5,0 While Not KeyDown(1) ; Until we press ESC If KeyDown(200) Then RotateEntity parent_cube, 10,10,10 EndIf RenderWorld ; Draw the Scene Flip Wend; |
| ||
Changeparent_cube = CreateCube to parent_cube = CreateCube() |
| ||
AHA! Oops silly me, thanks. Thats wot happens when code cut code at 3 in the morning! |