Nearfield clipping stop my md2 animations

28 views
Skip to first unread message

Texugo

unread,
Jan 4, 2011, 1:05:23 PM1/4/11
to Away3D.dev
Hi buddies
Happy new year 4 all us :-)

Well ... i got a problem. I have a almost complete turn-based game
made in away3d, but i have a problem about clipping and animations.
I got a scene with 2 animated md2 characters in a closed room and the
camera must sometimes be near of character 1, and sometimes must be
near of character 2. For the closed room polygons does´nt break i
about ot use NearfieldClipping.
The problem is ... when camera comes to character 1, character´s 2
animation stop and vice-versa. Then i think "Theres must be a problem
in z values of NearfieldClipping". Well ... my 2 characters got a
distance between it of 200 units ... then i change maxZ value´s to
1000 and does´nt work ... and does´nt matter the maxZ value ... one of
two character animations stop!. I try FurstumClipping and got the same
problem. If i use RectangleClipping the polygons of closed rom breaks.

Please, i dont know how to solve this ... besides i got months of work
in this game :-|
Thanx

Just a little note: the camera runs and rotate in scene, apply
position and apply rotations seems make no diference, i dont´t know if
this helps...
Another one, i use away3d 3.5.
Thanx Again

Texugo

unread,
Jan 5, 2011, 10:52:18 PM1/5/11
to Away3D.dev
No Ideas buddies? Any idea will be welcome!

Aji Pamungkas

unread,
Jan 5, 2011, 11:16:40 PM1/5/11
to away3...@googlegroups.com
Hi Texugo,

Could you please provide us the example ?
IMO, i don't think there is a connection between clipping and model's animation. Maybe, you are trying to call an animation name in character 2 which doesn't exists.

--
Aji Pamungkas

Texugo

unread,
Jan 8, 2011, 11:02:23 AM1/8/11
to Away3D.dev
Thanx for reply Aji ... and sorry about my delay in reply 'cos i have
to make a little demo to you see by yourself the problem.

http://www.doutorpalhaco.com/away3d_example/

I guess my problem is not about know or not the model animations. In
the beginning of scene both characters are animated. And then, in
Nearfiledclipping, when camera approaches to character01, character02
stops animation. When camera goto character02 this character play
again your animation (by itself, cos all animations are in loop), and
character01 stop your animation (by itself). If i use
RectangleClipping i have no problem with animation, but scene cracks,
besides the fact i've increase number of faces of scene.

My guess about Clipping problem and not animation problem is about
everything outside of view clipping is not updated (animations
included). Does'nt matter how i change NearfieldClipping.maxZ or
NearfielClipping.minZ the results are the same. Someone know if minZ
and maxZ are absolute in world coordinates or relative in view
coordinates? There's some other way, in rectangleClipping, to make my
scene don't crack (this solve the problem too).

Thanx , all idea will be welcome!

Aji Pamungkas

unread,
Jan 8, 2011, 12:57:14 PM1/8/11
to away3...@googlegroups.com
Hi Texugo,

Wooowww. You're making a fighting game, coolll...

I also use MD2, and I don't have the same problem like you. After seeing my game's code, i realize that i use Away3D 3.5, FrustumClipping, PerspectiveLens, and i don't change maxZ at all. And when my character is far away from the camera, it's  animation are still working just fine.
--
Aji Pamungkas

Texugo

unread,
Jan 8, 2011, 2:28:40 PM1/8/11
to Away3D.dev
Aji

I try your tip and have same results about NearfieldClipping (in
examples is already use PerspectiveLens in camera). Dawn weirdo
problem ....
How about the position of your characters in your game? All of it are
in positive Z axis? Did you change something in min/maxX and min/maxY
clipping?
In your game camera changes position and have no problem ?

Thanx again

On 8 jan, 15:57, Aji Pamungkas <aji.rifa.pamung...@gmail.com> wrote:
> Hi Texugo,
>

Fabrice3D

unread,
Jan 8, 2011, 5:54:58 PM1/8/11
to away3...@googlegroups.com
does it stops only when camera is still?
Fabrice

Aji Pamungkas

unread,
Jan 8, 2011, 8:30:17 PM1/8/11
to away3...@googlegroups.com
Yes... i can see that in your game, the animation stops only when you use other than RectangleClipping. That's kinda weird. :D

Texugo, the position of my main char are in XZ plane. I don't use Y axis, because i don't need it. I don't change minZ nor maxZ properties in the mesh, and for the clipping, I only change minZ to 1. I use hover camera, and yes... it changes it's position when keyboard is pressed.

Everytime i want to call other animation's name, I always stop current animation.

private function stopCurrentAnimation(maincharView:MaincharView,atLastFrame:Boolean=false):void
{
if (_proxy.getCurrAnimationName() == "")
return;
var animData:AnimationData = maincharView.mesh.animationLibrary.getAnimation(_proxy.getCurrAnimationName());
if (animData != null && animData.animator.isPlaying)
{
if (atLastFrame)
animData.animator.gotoAndStop(animData.animator.totalFrames - 1)
else
animData.animator.gotoAndStop(0);
}
_proxy.setCurrAnimationName("");
}

public function playAnim(maincharView:MaincharView,animName:String,fps:uint,loop:Boolean):void
{
stopCurrentAnimation(maincharView);
_proxy.setCurrAnimationName(animName);
var animData:AnimationData = (maincharView.mesh.animationLibrary.getAnimation(animName) as AnimationData);
if (animData == null)
return;
animData.animator.fps = fps;
animData.animator.loop = loop;
animData.animator.gotoAndPlay(0);
}

Those are methods that i use to play and stop MD2 Animations. So that I can do this :
if (bKeyUpIsPressed)
{
   if (viewChar1.state != STATE_WALK)
   {
       viewChar1.state = STATE_WALK;
       playAnim("WALK_", viewChar1, 10, true);
   }
}
else if (bKeySpaceIsPressed)
{
   if (viewChar1.state != STATE_SHOOT)
   {
       viewChar1.state = STATE_SHOOT;
       playAnim("SHOOT_", viewChar1, 10, true);
   }
}

The "_" char in the animation names were automatically inserted by Blender MD2 Export Script, I don't know why. :D

Hey... why don't you try to trace your AnimationData's animator by showing your Animator's properties in Debug Output of FlashDevelop, such as : isPlaying, currentFrame, addEventListener of AnimatorEvent, etc...

Good luck.
--
Aji Pamungkas

Texugo

unread,
Jan 9, 2011, 1:15:42 AM1/9/11
to Away3D.dev
Hi fabrice

Not at all. Seems to me it stops when camera goes far from character.
The distance between both characters is about 200 units. The initial
camera's distance of characters is about 400 units. My actual camera
is TargetCamera with Perspective lens. I move the camera with
tweenlite with a onComplete defined a camera.lookAt(opposite
character).
That's the weirdo ... in initial camera position both characters have
animation ... when camera goes to character 1, character 2 animation
stop, beside the fact the distance from character 1 and character 2 is
smaller than initial camera position... and vice versa.
I try change maxZ=10000 in Nearfield/Frustum Clipping without
sucess :-|. The maxZ it's about view coordinates or about global
coordinates?
I must be missing something....

Thanx, all ideas are welcome.

Texugo

unread,
Jan 9, 2011, 1:20:21 AM1/9/11
to Away3D.dev
Hi aji

Great idea! I try this and ... another weirdo :-) ...
When camera goes to character1, character2 stop animation, but
animator.isPlaying = true
I can be wrong but i guess is not about animations.

Thanx 4 help

Fabrice3D

unread,
Jan 9, 2011, 4:47:10 PM1/9/11
to away3...@googlegroups.com
what if you make the guys way bigger? Can you try make for the sake of test say 2 frames animation for one of the guys, but at least 10 times bigger
and see if you get same problem.

Fabrice

Texugo

unread,
Jan 9, 2011, 10:40:28 PM1/9/11
to Away3D.dev
Fabrice

I'm not quite sure if a understand your idea. If is about increase fps
of animation i already try it with same results :-| . If this is not
your idea, please tell more about ;).
I try another crazy things and get 2 more pieces of mistery :

a) I moved character 1 to x=0 and character 2 still in x=100. There's
no more problem about animations stop.
b) Just a despair maneuver ... i change minY to 0 from clipping (Near
and Frustum) and besides the fact i have only half-screen rendered in
view i have no problems with animations stop! (character1.x=-100 and
character2.x=100);

Crazy weirdo! If theres some way to my scene don't crack when i use
Rectangle Clipping i forget all this problem.

Thanx and all crazy (or not) ideas are welcome

Fabrice3D

unread,
Jan 10, 2011, 5:31:40 AM1/10/11
to away3...@googlegroups.com
I have some hint behind my head...
Your models are, base of the unit that separated them, very small.
Just make a simple 2 frames animation in your editor of your avatar but at a bigger scale.
Where it is now 30 to 40 units high in Away, ensure that once loaded it is say 1000 or more.

Fabrice

Texugo

unread,
Jan 10, 2011, 9:39:28 PM1/10/11
to Away3D.dev
Fabrice

Weirdo ... it works fine :-)
I don't know why and i don't know why... but works.
A lot of thanx

Fabrice3D

unread,
Jan 11, 2011, 3:56:56 AM1/11/11
to away3...@googlegroups.com
Its not weird at all, in contrairy...
Glad it fixes your issue.

Fabrice

Aji Pamungkas

unread,
Jan 11, 2011, 4:51:27 AM1/11/11
to away3...@googlegroups.com
Congratulations... :D
--
Aji Pamungkas

Texugo

unread,
Jan 11, 2011, 1:12:50 PM1/11/11
to Away3D.dev
Aji and Fabrice
A lot of thanx


On 11 jan, 07:51, Aji Pamungkas <aji.rifa.pamung...@gmail.com> wrote:
> Congratulations... :D
>
> ...
>
> mais »
Reply all
Reply to author
Forward
0 new messages