/* scr_tree() argument0 = x argument1 = y argument2 = z */ OX = argument0 OY = argument1 OZ = argument2 d3d_draw_cylinder(OX-15,OY-15,OZ,OX+15,OY+15,OZ+80,background_get_texture(tex_palme),1,5,true,8) d3d_transform_add_rotation_y(330) d3d_draw_cylinder(OX-15-75,OY-15,OZ+220,OX+15-75,OY+15,OZ+275,background_get_texture(tex_palme),1,5,true,8) d3d_transform_add_rotation_y(-330) d3d_draw_ellipsoid(OX-90+30,OY-80,OZ+100,OX+90+30,OY+80,OZ+175,background_get_texture(tex_blatt),2,2,8) d3d_transform_add_rotation_y(270) d3d_draw_cylinder(OX-5-400,OY-5,OZ+325,OX+5-400,OY+5,OZ+375,background_get_texture(tex_palme),1,5,true,8) d3d_transform_add_rotation_y(-25) d3d_draw_cylinder(OX-5-550,OY-5,OZ+300,OX+5-550,OY+5,OZ+330,background_get_texture(tex_palme),1,5,true,8) d3d_transform_add_rotation_y(-245) d3d_draw_ellipsoid(OX-45+80,OY-40,OZ+35,OX+45+80,OY+40,OZ+75,background_get_texture(tex_blatt),2,2,8)
As you ceen see i used d3d_transform_add_rotation to draw some branches but, and as long z = 0 it works finde, but as soon z is different form 0 the tree breaks.. (because the axes rotate too and i have to use a different z that is relativ to the rotation, but i've no idea how to achieve this)
I hope you can understand what i mean in spite of my crappy english
Can anyone tell me how to calculate that new relativ z?
or a function that can help me?
Thank you
Edited by ck2k, 13 October 2010 - 11:44 AM.











