[3.6] Center Meshs

Software: Away3D 3.x

Tempy111, Sr. Member
Posted: 19 March 2016 08:57 PM   Total Posts: 133

okay, I’m not quite sure but it seams I have a problem with reused models not centring correctly.

When I load them (they are MD2s) I can give a centre command. on the next level, I reuse the mesh instead of reloading, but it appears it seams to be Losing the centring now. I can’t find any centre command in the Meshs API to deal with this issue.. so i’m a little clueless..

I guess I can probably try to figure out the offsetting for a manual adjustment but.. i’m just wondering if there is some way to reset the centring

   

Avatar
Fabrice Closier, Administrator
Posted: 19 March 2016 09:14 PM   Total Posts: 1265   [ # 1 ]

md2s animations are composed of multiple frame buffers.
if you want to recenter an md2 or any morph data, apply the offsets in each frames. Otherwize, it will apply for the current frame, and overwrite once it plays with the original data stored into the frames.

   

Tempy111, Sr. Member
Posted: 19 March 2016 09:20 PM   Total Posts: 133   [ # 2 ]

damn… mm.. wonder why it is offsetting though reloading the MD2 each time was leading to memory issues where as this decreases them by a lot (reducing about 36mb to about 1mb) doing each frame should be possible but might be tricky.. okay.. I’ll look into another way around it ^_^ thanks

   

Tempy111, Sr. Member
Posted: 20 March 2016 11:09 AM   Total Posts: 133   [ # 3 ]

forgot to ask.. any ideas why it might be kinda forgetting the centre?

   

Tempy111, Sr. Member
Posted: 20 March 2016 06:23 PM   Total Posts: 133   [ # 4 ]

okay.. the first time, the loader loads the md2 model. onloadcomplete, I do what I need to and use the e.loader.handle
.mesh and clone it for the mesh etc.. no problem..

now the second time.. I can’t reuse the mesh cause it seams to forget the centring.. so I decided to reuse the loader’s already loaded data as it wasn’t cleared..

using <loaderVar>.handle.clone() as Mesh is perfect it seams ^_^

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X