..hi guys..I need function for pivot placement on box corners created by Meshwidth,Meshdepth, Meshheight around choosen entity(each corner, one pivot). I am not sure does Meshwidth,Meshdepth, Meshheight depending on entity pivot itself(eg. mesh is exported from within 3D modelling tool but pivot is not placed in center of mesh). Anyone did something like that and willing to share or some nice suggestions will help if someone try to do this before..thanks a lot..
Pivots at Box corner
Blitz3D Forums/Blitz3D Programming/Pivots at Box corner Something like this?
[DUFF CODE]
see below ....
[DUFF CODE]
see below ....
Hi Stevie..can you post some working example since I got MAV with this function...error message is 'Step value must be constant'..soo..
Sorry ... jusy through it together ...
Try this ... note I replaced createpivot with createsphere() so you can see it.
Try this ... note I replaced createpivot with createsphere() so you can see it.
Graphics3D 640,480,16,1 Global cube = CreateCube() ScaleMesh cube, 10,10,10 EntityColor cube, 255,0,0 Global camera = CreateCamera() PositionEntity camera, 0,0,-50 CornerPivot( cube ) While Not KeyDown(1) TurnEntity cube, 1, 0, 1 RenderWorld() Flip Wend Function CornerPivot( Mesh , Loc = True ) Mw# = MeshWidth( mesh ) Mh# = MeshHeight( mesh ) Md# = MeshDepth( mesh ) ;center mesh FitMesh mesh , -Mw*.5, -Mh*.5 , -Md*.5 , Mw, Mh, Md For x# = -.5 To .5 Step 1 For y# = -.5 To .5 Step 1 For z# = - .5 To .5 Step 1 If Loc ; local placement pivot = CreateSphere( 4, mesh ) ;Pivot( mesh ) PositionEntity pivot, x*Mw, y*Mh, z*Md Else TFormPoint x*Mw, y*Mh, z*Md, mesh, 0 pivot = CreatePivot() PositionEntity pivot, TFormedX(), TFormedY(), TFormedZ() EndIf Next Next Next End Function
Stevie..thanks a lot..working great..