Away3D Forum 0 Copyright (c) 2017 ExpressionEngine tag:away3d.com,2017:09:08 How to apply a texture inside a CylinderGeometry tag:away3d.com,2017:forum/viewthread/.6259 2017-09-07T07:48:31Z 0 dakota I am using the following code to apply a texture on a CylinderGeometry

_plane = new Mesh(new CylinderGeometry(10010020064,,falsefalse), new TextureMaterial(Cast.bitmapTexture(FloorDiffuse)));
_view.scene.addChild(_plane); 

This code is applying the texture on the outside of the cylinder. Is there any way I can apply the texture to the inside surface of the CylinderGeometry?

]]>
How can we extract the animation of a web game Unity 3d .AWD tag:away3d.com,2017:forum/viewthread/.6249 2017-06-20T16:05:51Z 0 vietnamese I live in Vietnam, Currently I have a problem is a file v_file.awd contains the animation of a web game that I play, I do not know how to unpack it or open with what software. I hope you can help me to extract this file and exploit the resources from them (I mod Counter-Strike game) (I at the link: http://upthink.wap.sh/files/v_shovel[1].awd) http://upthink.wap.sh/images/untitled.JPG). I need to be able to covert out .obj ... Looking forward to helping me. Thank you

]]>
How to render two mesh in different projections simultaneously at the same time? tag:away3d.com,2017:forum/viewthread/.6248 2017-06-17T01:38:35Z 0 Vacuum bulb slave Question

]]>
How to render a plane in orthogonal, and a figure in a perspective projection? tag:away3d.com,2017:forum/viewthread/.6247 2017-06-16T07:35:17Z 0 Vacuum bulb slave How to render a plane in orthogonal, and a figure in a perspective projection?

This code not work.

package;

//   OpenFL   
import openfl.display.*;
import openfl.events.*;
import openfl.geom.Point;
import openfl.geom.Rectangle;
import openfl.text.TextField;
import openfl.text.TextFieldAutoSize;
import openfl.text.TextFormat;
import openfl.text.TextFormatAlign;
import openfl.Assets;
import openfl.Lib;
import openfl.geom.Vector3D;
//   Away3D   
import away3d.containers.*;
import away3d.entities.*;
import away3d.materials.*;
import away3d.primitives.*;
import away3d.utils.*;
import away3d.debug.AwayFPS;
import away3d.cameras.lenses.LensBase;       
    
import away3d.cameras.lenses.OrthographicLens
    
import away3d.cameras.lenses.PerspectiveLens

class 
Main extends Sprite {
 
 
private var _view:View3D;
 private var 
_plane:Mesh;
 private var 
_plane2:Mesh;
 private var 
_plane3:Mesh;

 public function new() 
{
  super
();
  
  
_view = new View3D();
  
addChild(_view);
   
_view.camera.800
   
_view.camera.= -500;
  
_view.camera.lookAt(new Vector3D());
    
   
  
//   ORTHOGRAPHIC   
  //_view.camera.lens = new OrthographicLens(); 
  
  
_plane = new Mesh(new PlaneGeometry(10241024 ), 
  new 
TextureMaterial(Cast.bitmapTexture("assets/45.jpg")));
  
_plane.0;
  
_plane.0;
  
_plane.= -220
  
_plane.rotationX = -30;
    
  
_plane2 = new Mesh(new PlaneGeometry(10241024), 
  new 
TextureMaterial(Cast.bitmapTexture("assets/56.jpg")));
  
_plane2.1024;
  
_plane2.0;
  
_plane2.= -220
  
_plane2.rotationX = -30;
 
 
  
//  PERSPECTIVE   
  //_view.camera.lens = new PerspectiveLens(); 

  
_plane3 = new Mesh(new PlaneGeometry(512512), 
  new 
TextureMaterial(Cast.bitmapTexture("assets/23.jpg")));
  
_plane3.0;
  
_plane3.0;
  
_plane3.= -220.01
  
_plane3.rotationX = -30;
    
  
_view.scene.addChild(_plane );
  
_view.scene.addChild(_plane2 );
  
_view.scene.addChild(_plane3 );
  
  
  
//setup the render loop
  
addEventListener(Event.ENTER_FRAME_onEnterFrame);
  
stage.addEventListener(Event.RESIZEonResize);
  
onResize();
  
 
}

 
private function _onEnterFrame(e:Event):Void {
  
  _view
.render();
  
 
}
 
private function onResize(event:Event null):Void {
  _view
.width stage.stageWidth;
  
_view.height stage.stageHeight;
 
}
 
]]>
loadermd5test & class which extends EventDispatcher tag:away3d.com,2017:forum/viewthread/.6239 2017-06-01T03:04:07Z 0 mkfui in away3d broomstick example, loadermd5test, if there are several animated mesh(several class which extends EventDispatcher), it didn’t work, why ? this message appear:

Error: Error #2032: Stream Error. URL: app:/players/pg3/model.png
at away3d.loaders::AssetLoader/onRetrievalFailed()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.loaders.misc::SingleFileLoader/handleUrlLoaderError()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

because of the MonsterEvent ? i am using loader instead of assetlibrary for different class which extends EventDispatcher
can anyone help me solve this problem? any differences in coding by using different version of away3d? if yes, how ? now i am embedded all my enemies into the main file separate it with different loader
please demonstrate it

]]>
3D to 2D coordinates conversion tag:away3d.com,2017:forum/viewthread/.6238 2017-05-30T09:47:33Z 0 saadaftab90 Hi friends.

mesh.addEventListener( MouseEvent3D.MOUSE_DOWN, onObjectMouseDown );

function(evt:MouseEvent3D) {
trace(evt.uv);
}

I want the exact same result like ‘evt.uv’ but without using MouseEvent3D. HELP PLEASE !!!

]]>
Animation suspends when Gargbage Collector cleans the memory tag:away3d.com,2014:forum/viewthread/.5372 2014-03-18T09:30:44Z 2014-03-18T09:38:37Z stani.spb I use md5 models for animation. I noticed a small problem which can be serious enough for making a game on Away3d technology. When animation is started , memory consumption immediately begin to grow average 1 kb per each enterFrame call. I found no memory allocations in my code. Scout showed that this small memory allocations occur in a View3d.render chain (i.e. in Object3d.lookAt function).

This would not be such a big poblem as Garbage Collector cleans the memory periodically. The problem is when GC cleans the memory, animation suspends for a second (iOS, PC)  which will be not a pleasant surprise for gamer.

Does anyone succeeded to escape such animation pauses on these constant GC memory cleans?

]]>
AnimationClipState making shared nodes dispatch PLAYBACK_COMPLETE events… tag:away3d.com,2017:forum/viewthread/.6222 2017-05-04T05:39:37Z 2017-05-04T05:39:08Z Kicker Hi, I noticed that I had some weird things happening when attaching listeners to SkeletonClipNode for PLAYBACK_COMPLETE event.

I quickly realized that when triggering the event for one animated mesh, ALL the listeners across the cloned meshes were called.

That’s when I took a look at the animator.clone function that I understood:

public function clone():IAnimator
{
 
/* The cast to SkeletonAnimationSet should never fail, as _animationSet can only be set
  through the constructor, which will only accept a SkeletonAnimationSet. */
 
return new SkeletonAnimator(_animationSet as SkeletonAnimationSet_skeleton_forceCPU);

You don’t clone the animation set…

Now I couldn’t help but notice that classes that implement IAnimator are also event dispatchers…

So I modified this code in AnimationClipState…
Before:

private function notifyPlaybackComplete():void
{
    _animationClipNode
.dispatchEvent(_animationStatePlaybackComplete ||= new AnimationStateEvent(AnimationStateEvent.PLAYBACK_COMPLETE_animatorthis_animationClipNode));

After:

private function notifyPlaybackComplete():void
{
    _animationStatePlaybackComplete 
||= new AnimationStateEvent(AnimationStateEvent.PLAYBACK_COMPLETE_animatorthis_animationClipNode);

    if(
_animator is IEventDispatcher)
        (
_animator as IEventDispatcher).dispatchEvent(_animationStatePlaybackComplete);

    
_animationClipNode.dispatchEvent(_animationStatePlaybackComplete);

And now I just add my PLAYBACK_COMPLETE listener to the animator instead of doing it for every single animation node…

]]>
Error: A Material instance cannot be shared across renderables with different animator libraries tag:away3d.com,2017:forum/viewthread/.6221 2017-05-02T08:18:08Z 0 Kicker Hi,

I’m having a weird problem whem loading several animated meshes into the game…

Here’s the code called on ASSET_COMPLETE:

private function onMD5ResourceComplete($e:AssetEvent):void
{
 
var node:SkeletonClipNode;
 var 
animator:SkeletonAnimator;
 var 
asset:IAsset $e.asset;
 var 
name:String asset.assetNamespace;
 var 
animation_set:SkeletonAnimationSet;

 
LightLogger.log("onMD5ResourceComplete " name " " asset.assetType);

 if (
asset.assetType == AssetType.ANIMATION_SET)
 
{
  animation_set 
asset as SkeletonAnimationSet;
  
animator = new SkeletonAnimator(animation_set_md5Meshes[name].skeleton);
  
_md5Meshes[name].mesh.animator animator;
  
_md5ReadyRope.cutFiber(name);
 
}
 
else if (asset.assetType == AssetType.SKELETON)
 
{
  
if(_md5Meshes[name] == null)
   
_md5Meshes[name] {};
  
_md5Meshes[name].skeleton asset as Skeleton;
 
}
 
else if (asset.assetType == AssetType.MESH)
 
{
  
if(_md5Meshes[name] == null)
   
_md5Meshes[name] {};
  
_md5Meshes[name].mesh asset as Mesh;
  
_md5Meshes[name].mesh.castsShadows true;
 
}

And here’s the logged result:

onMD5ResourceComplete Sleepy.md5mesh geometry
onMD5ResourceComplete Sleepy
.md5mesh mesh
onMD5ResourceComplete Sleepy
.md5mesh skeleton
onMD5ResourceComplete Sleepy
.md5mesh animationSet
onMD5ResourceComplete Angry
.md5mesh geometry
onMD5ResourceComplete Angry
.md5mesh mesh
onMD5ResourceComplete Angry
.md5mesh skeleton
onMD5ResourceComplete Angry
.md5mesh animationSet
[Fault] exception
information=ErrorA Material instance cannot be shared across renderables with different animator libraries 

Thanks in advance.

]]>
AIR SDK 25 tag:away3d.com,2017:forum/viewthread/.6213 2017-04-13T14:54:14Z 0 cph I currently have a successful implementation of the last Away3D source(4.x) using the Air SDK 23, but since the release of the Air SDK 24 and 25, I am unable to get Away3D to initialize at all. Does anyone have any suggestions?

Note: I am using stage3DManager and stage3DProxy too.

]]>