First before try give answer: I have uploaded an update of Prefab3D last nite...

few highlights of this update beside many internal changes

- drag box improved, drags now correctly
- panes are now reacting to mouse wheel
- autoselect of row in rendering pane on object selection
- obj load from menu: url resolving
- bump from source in xtra prop panel
- unique mesh names control improved


about your problem
looking at your code, the reason why you do not see your model
is because you do not add it to the scene...
also one detail, a model is by default placed when addChilded to 0,0,0

so if you just
view.scene.addChild(md2model);
just before camera,lookAt(md2model.position);
and have at least one view.render(); after that, you MUST see it.

If it looks big is not perse related to its scale but to the distance it is from camera (and cam settings)

so if you set camera at say: 5000,5000,5000 before lookat, you will see something!
then change distance or scale accordingly.

About the lights,
keep in mind that lights in Prefab3D are there to allow prerendering.
runtime you will not get this level of finish. plus multiple light support is kinda cpu intensive

best practice is in case of combo statics+animated meshes, such as your project is to prerender with as many lights as you wish but have one major light that can be used for the md2 to make it "fit" better in your scene A good trick is to render as raytrace with no shadow, and have huge light above and far from item this way, runtime having this top lightning looks natural and if your md2 model do not have any other rotations than on the Y axis, it will probably
not even require any dynamic lights, saving lots of power...

Fabrice




On Oct 30, 2009, at 1:59 AM, Sunil John wrote:


Hi Fabrice,

Thanks for the prompt and detailed response.

I suppose I should have been more detailed with my problem. The model
I'm using is a MD2, and in my Away3D scene I have to scale my model
down to 0.005 to see the entire model.

Here's my code:

scene=new Scene3D();
camera=new Camera3D({clipping: new FrustumClipping()});
view=new View3D({scene: scene, camera: camera});
addChild(view);

md2model=Md2.parse(Cast.bytearray(new Model()), {scale: .005});
modelTexture=new WhiteShadingBitmapMaterial(Cast.bitmap(Texture));
md2model.material=modelTexture;
md2model.x=0;
md2model.y=0;
md2model.z=0;

camera.lookAt(md2model.position);

What is strange to me is that in the preFab scene the model's object3d
scale says 1 and the the distance is 13069. If I scale my model in my
Away3d scene to 1, it's scaled up so big i can only see part of it.
Should I be using a HoverCam?

I would think I need to have the same scene, camera and model scale
settings in both my away3d scene and prefab scene, if I want to apply
the various values for lights etc that are in my preFab scene to my
Away3D scene. When I rescale my model in preFab, the model is rescaled
but the number snaps to 1. Why does it snap to 1? Sorry if these are
noob questions.

Thanks for your help. I've only be using preFab for a couple hrs and
it's pretty awesome!

Sunil

Reply via email to