11 12
发新话题
打印

拆散兄,一些二维代码啊,,立体方形转动

拆散兄,一些二维代码啊,,立体方形转动

拆散兄,一些二维代码啊,,立体方形转动 .z; depth=depth/(-4); plane6.swapDepths(depth); amount=depth/50*100+15; new Color(plane6).setTransform({ra:amount,ga:amount,ba:amount}); }*/ ================================================================
附件: 您所在的用户组无法下载或查看附件

TOP

拆散兄,一些二维代码啊,,立体方形转动

不行,我不会

TOP

拆散兄,一些二维代码啊,,立体方形转动

我也不会,,空间问题的,
二维数组的吧

TOP

拆散兄,一些二维代码啊,,立体方形转动

create_planes(); 是放在_root.onEnterFrame 内,反复地绘制6个面
如果把图片载入到6个MC内,意味着要不停地调整位置,这还是小事,关键是MC不可能扭曲变形

TOP

拆散兄,一些二维代码啊,,立体方形转动

http://www.86vr.com/teach/works/200303/704.html

TOP

拆散兄,一些二维代码啊,,立体方形转动

想了一下,用flash8的某些功能,应当可以,不过我没时间试

TOP

拆散兄,一些二维代码啊,,立体方形转动

[quote][b]下面引用由[u]拆散6119[/u]在 [i]2006/04/15 01:55pm[/i] 发表的内容:[/b]
想了一下,用flash8的某些功能,应当可以,不过我没时间试
[/quote]
那就没办法啦,呵呵,,,
6楼的,那个强,,各部分还有提示功能

TOP

拆散兄,一些二维代码啊,,立体方形转动

http://www.flashkit.com/tutorials/3D/3D_Engin-KStor-189/more3.php

TOP

拆散兄,一些二维代码啊,,立体方形转动

学了一招

TOP

拆散兄,一些二维代码啊,,立体方形转动

在蓝色看到的代码,很精简tiger1018写的,转过来: 把以下的代码复制到住场景第一帧,然后在导入六张图片,图片的连接标识符为image0到image5,就好了 Stage.scaleMode = ';noScale';; var rotations = {x:0, y:0, z:0}; var boxPoints = [{x:-50, y:-50, z:-50}, {x:50, y:50, z:-50}, {x:-50, y:50, z:-50}, {x:-50, y:-50, z:50}, {x:50, y:-50, z:50}, {x:50, y:50, z:50}]; this.createEmptyMovieClip("theScene"+1, 1); theScene1._x = theScene1._y=200; createImages(); theScene1.onEnterFrame = function() { rotations.x -= this._ymouse/1000; rotations.y += this._xmouse/1000; var points2d = pointsTransform(boxPoints, rotations); movieClip3PointTransform(this.image0, points2d[2], points2d[0], points2d[3]); movieClip3PointTransform(this.image1, points2d[5], points2d[1], points2d[2]); movieClip3PointTransform(this.image2, points2d[0], points2d[2], points2d[1]); movieClip3PointTransform(this.image3, points2d[4], points2d[3], points2d[0]); movieClip3PointTransform(this.image4, points2d[3], points2d[4], points2d[5]); movieClip3PointTransform(this.image5, points2d[1], points2d[5], points2d[4]); }; function createImages() { var i = 6; while (i--) { theScene1.createEmptyMovieClip("image"+i, i); theScene1["image"+i].createEmptyMovieClip("contents", i); theScene1["image"+i].contents.attachBitmap(flash.display.BitmapData.loadBitmap("image"+i), 1, false, true); } } function pointsTransform(points, rotations) { var tpoints = new Array(); var sx = Math.sin(rotations.x); var cx = Math.cos(rotations.x); var sy = Math.sin(rotations.y); var cy = Math.cos(rotations.y); var sz = Math.sin(rotations.z); var cz = Math.cos(rotations.z); var x, y, z, xy, xz, yx, yz, zx, zy; var i = points.length; while (i--) { x = points[i].x; y = points[i].y; z = points[i].z; xy = cx*y-sx*z; xz = sx*y+cx*z; yz = cy*xz-sy*x; yx = sy*xz+cy*x; zx = cz*yx-sz*xy; zy = sz*yx+cz*xy; tpoints[i] = {x:zx, y:zy}; } return tpoints; } function movieClip3PointTransform(mc, a, b, c) { mc._visible = ((b.y-a.y)/(b.x-a.x)-(c.y-a.y)/(c.x-a.x)<0) ^ (a.x<=b.x == a.x>c.x); if (mc._visible) { var m = mc.transform.matrix; m.tx = b.x; m.ty = b.y; m.a = (a.x-b.x)/mc.contents._width; m.b = (a.y-b.y)/mc.contents._width; m.c = (c.x-b.x)/mc.contents._height; m.d = (c.y-b.y)/mc.contents._height; mc.transform.matrix = m; } }

TOP

 11 12
发新话题