actionscript-3 - As3 Flash: 3d 个网格的属性

  显示原文与译文双语对照的内容
0 0

下面我特意做了一个测试脚本: you我已经很喜欢了,我已经在这里stuck了 20小时了note:i 我已经stuck了。plane plane 。


import away3d.containers.Scene3D;
import away3d.containers.View3D;
import away3d.containers.ObjectContainer3D;
import away3d.debug.AwayStats;
import away3d.entities.Mesh;
import away3d.containers.ObjectContainer3D;
import away3d.loaders.Loader3D;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import away3d.*;
import away3d.materials.ColorMaterial;
import away3d.materials.TextureMaterial;
import away3d.textures.BitmapTexture;
import sunag.animation.AnimationTarget;
import sunag.events.SEAEvent;
import sunag.sea3d.SEA3D;
import away3d.materials.methods.*;
import away3d.primitives.*;
import away3d.textures.*;
import away3d.utils.*;
import away3d.events.*;
[SWF(width ="955",height ="600",frameRate ="50")]
var view:View3D;
var scene:Scene3D;
var sea3d:SEA3D;
var _container:ObjectContainer3D = new ObjectContainer3D();
[Embed(source ="Models/plane.sea",mimeType ="application/octet-stream")]
var homepage:Class;
stage.stageFocusRect = false;
stage.showDefaultContextMenu = false;
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
scene = new Scene3D();
view = new View3D(scene);
view.backgroundColor = stage.color;
view.antiAlias = 4;
var dat:BitmapData = new BitmapData(256, 256, false, WHATEVERCOLOUR);
var mMaterial = new TextureMaterial(new BitmapTexture(dat));
scene.addChild(_container);
addChild(view);
sea3d = new SEA3D();
view.blendMode = BlendMode.NORMAL;
sea3d.addEventListener(SEAEvent.COMPLETE, onComplete);
sea3d.loadBytes(new homepage());

function onEnterFrame(e:Event):void
{

 var body1:Mesh = sea3d.getMesh("body");
 body1.material = mMaterial;
 view.render();
 }
 function onComplete(e:SEAEvent):void
 {
 view.camera = sea3d.getCamera("Camera001");
 stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
 scene.addChild(sea3d.container);
 }

时间: 原作者:

0 0

我相信这就是你要寻找的内容: SubMeshes

从模型中提取的网格通常至少在SubMesh上进行,但可以包含几个。 更改"root"网格对象上的材质不会传播到它的SubMeshes 。 你需要循环遍历它的SubMeshes并更改它们的。

HTH 。

...