Figure of a human

Software: Away3D 4.x

Richard Olsson, Administrator
Posted: 30 August 2012 06:41 PM   Total Posts: 1192   [ # 31 ]

SkeletonClipNode. Please re-read this thread again as I’ve already mentioned some of these things.

 

   

Spontan231, Jr. Member
Posted: 30 August 2012 07:29 PM   Total Posts: 37   [ # 32 ]

First of all I want to find out how move joints by mouse. I found this example, but it’s in 2d. Do you think I can use some code from it?

mouse joints

 

   

Richard Olsson, Administrator
Posted: 31 August 2012 07:25 AM   Total Posts: 1192   [ # 33 ]

Probably not since that tutorial doesn’t seem to have anything to do with Away3D, but is instead about physics using Box2D.

You should do things one at a time. Start by cloning the clip node class and use your clone to assemble a node tree that you can play in an animator. Then try to strip out the parts that use clips from your custom node type. Then try to add some procedural logic (e.g. randomness or sine curves or whatever) to set the pose. Finally, try to make it follow the mouse instead.

 

   

Spontan231, Jr. Member
Posted: 31 August 2012 11:12 AM   Total Posts: 37   [ # 34 ]

Whould you give me some examples of books that whould help me to understand this matter?

 

   

Richard Olsson, Administrator
Posted: 31 August 2012 01:28 PM   Total Posts: 1192   [ # 35 ]

What exactly? I’m afraid there are no books on Away3D 4, and very little resources if any on how to modify and extend the skeletal animation system, which is what you need to do here.

Are you comfortable with ActionScript in general? Have you used Away3D for any more basic applications before? Maybe you need to start simpler and get some general experience with the environment before taking on this quite complex task.

 

   

Spontan231, Jr. Member
Posted: 02 September 2012 07:46 AM   Total Posts: 37   [ # 36 ]

Until now I used VB and I’m very good at it. I’m very determined to complete this aplication. Maybe if you will tell me what funtions I should use this will help me to move forward.

 

   

Richard Olsson, Administrator
Posted: 03 September 2012 12:21 PM   Total Posts: 1192   [ # 37 ]

Really the best information I can give you without actually coding the application for you and giving you the code is to look at the way the clip node works, and replace the logic in there, as explained previously in this thread, with your own logic.

Please read this entire thread again for more information about the specific functions in the node interface, et c.

 

   

Spontan231, Jr. Member
Posted: 14 October 2012 12:27 PM   Total Posts: 37   [ # 38 ]

Hi,

I think I’m getting closer to the solution. Correct me if I’m wrong. I want to get access to every bone and set them as sprites:

var bone001:sprite = model.getbonebyname(“bone001”);

then I will use appendRottaion for every direction:

bone001.transform.matrix3d.appendRotation(1,Vector3d.X_Axis);
bone001.transform.matrix3d.appendRotation(1,Vector3d.Y_Axis);
bone001.transform.matrix3d.appendRotation(1,Vector3d.Z_Axis);

I don’t know if I should use after that matrix3d.translation.

then I will build a hierarchy of bones

bone001.addchild(bone002);
bone002.addchild(bone003);

I get it from adobe help and I don’t know if it’s able to use with Away3d.

 

   

Richard Olsson, Administrator
Posted: 15 October 2012 08:05 AM   Total Posts: 1192   [ # 39 ]

Where exactly did you get that tip from? You definitely do not need to use sprites. It’s true you may need to do some matrix math, but you definitely do not need sprite instances to be able to use Matrix3D.

Anyway, the notion that you need to use matrices is probably right (depending on your exact scenario) but the approach that you have taken to it, using the built-in Flash display list objects, is not on the right track.

As I have explained, you should start by creating an exact copy of the clip node class, and setting up a animation set with an instance of that class as one of the root nodes and play it. Everything should then work exactly as any other pre-recorded clip. From there, start modifying the class until you get a feeling for how to control animation procedurally. When you have, replace the entire logic inside that class to instead match your desired logic, be it mouse-control or whatever.

 

   

Spontan231, Jr. Member
Posted: 18 October 2012 08:59 PM   Total Posts: 37   [ # 40 ]

OK. I’m trying to do what You say but I’m stuck. I want to use the HellKnight example to load my MD5 model and I use some code from there. Unfortunetly I’m getting an error:

1084: Syntax error: expecting rightbrace before end of program.

My code is in the uploaded file.

 

File Attachments
Znam.as  (File Size: 4KB - Downloads: 284)
   

Richard Olsson, Administrator
Posted: 19 October 2012 06:44 AM   Total Posts: 1192   [ # 41 ]

I’m afraid the forum won’t allow downloads of AS files. But the error is something that happens when you have more “{” than “}” in your program. So make sure all your braces are balanced.

I’m inclined to fall back onto encouraging you to take on a simpler example first and try to achieve this in small steps.

 

   

Spontan231, Jr. Member
Posted: 20 October 2012 09:39 PM   Total Posts: 37   [ # 42 ]

OK. I found a problem. In Asp.net the brace are underlined when they have no closing. I also manage to load the model, but he is in black and white colors. So now I will work on the update skeleton pose.

 

   

Spontan231, Jr. Member
Posted: 24 October 2012 05:48 PM   Total Posts: 37   [ # 43 ]

@Richard. Do you think I should use the vertices method made in this tread forum/viewthread/1732/?

 

   

Spontan231, Jr. Member
Posted: 26 October 2012 12:02 PM   Total Posts: 37   [ # 44 ]

I will get back to the SkeletonClipNode. I have a problem to import animators.nodes. I import this package, but I’m getting an error with f.e. _framesDirty. It’s getting me an error: Acces of undefined property _framesDirty.

This is my code:

package
{
import away3d.animators.nodes.*;
import away3d.animators.data.*;
import flash.geom.*;

[SWF(backgroundColor=”#000000”, frameRate=“60”, quality=“LOW”)]

public class Znam extends Sprite
{

private var _frames:Vector.<SkeletonPose> = new Vector.<SkeletonPose>();
private var _rootPos : Vector3D = new Vector3D();
private var _currentPose : SkeletonPose;
private var _nextPose : SkeletonPose;
private var _oldFrame:uint;
private var _timeDir:int;

private var _skeletonPose : SkeletonPose = new SkeletonPose();
private var _skeletonPoseDirty : Boolean = true;

public var highQuality:Boolean = false;

public function get frames():Vector.<SkeletonPose>
{
return _frames;
}

public function get currentPose() : SkeletonPose
{
if (_framesDirty)
updateFrames();

return _currentPose;
}

public function get nextPose() : SkeletonPose
{
if (_framesDirty)
updateFrames();

return _nextPose;
}
}
}

 

   

Spontan231, Jr. Member
Posted: 26 October 2012 04:09 PM   Total Posts: 37   [ # 45 ]

Now I see that SkeletonClipNode extends AnimationClipNodeBase.

So I need to make my own SkeletonClipNode class but how can I add it to my project? At the begining I need to extend Sprite to upload my model. Then I need to use private function onAssetComplete, but how can I bind it to made by me SkeletonClipNode class??

Maybe when someone could show me where is the animator in HellKnight example that would help me a lot.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X