Object is too small to recognize it.

Software: Away3D 3.x

raivispurins, Newbie
Posted: 29 June 2011 06:46 PM   Total Posts: 3

Hello, as I mention before, I`m just beginner with 3D library, but it is pain in the ass, if something goes wrong. So, the question is:

I followed tutorial in flashmagazine.com, but something is missing. I created class that contains everything for simple sphere creation, and everything works fine, except, that sphere on my stage looks too small to recognize it. Any explanations?

package {
import away3d
.containers.View3D;
import away3d.primitives.Sphere;
import flash.display.Sprite;
public class 
Basic01 extends Sprite {
public function Basic01() {
var view:View3D = new View3D({x:500,y:250});
addChild(view);
var 
sphere:Sphere = new Sphere();
view.scene.addChild(sphere);
view.render();
}
}
   

Avatar
Ringo Blanken, Administrator
Posted: 30 June 2011 07:32 AM   Total Posts: 120   [ # 1 ]

Aloha,

At default the radius of the sphere is 100. So if you want it bigger modify

var sphere:Sphere = new Sphere();

to

var sphere:Sphere = new Sphere();
sphere.radius = 200; // or any number greater then 100.

Option2:
You could also move the camera close to the sphere. At default the camera created at .z = -1000;
(And there sphere’s center is at .z = 0)

To move the camera modify

var sphere:Sphere = new Sphere();

to

var sphere:Sphere = new Sphere();
view.camera.z = -500; // or any number less then -1000;

The last option would be the move there sphere closer to the camera
like sphere.z = -400;

Good luck:)

Cheers,
Ringo.

 Signature 

Freelancer: http://www.ringo.nl/en/
http://www.jiglibflash.com
http://www.awayphysics.com
http://www.away3d.com

   

Richard Olsson, Administrator
Posted: 30 June 2011 08:07 AM   Total Posts: 1192   [ # 2 ]

Make sure you have the latest version of the flash player. There was a bug before 10.0.12 with Matrix math causing problems like this.

   

raivispurins, Newbie
Posted: 30 June 2011 07:26 PM   Total Posts: 3   [ # 3 ]

Thank you, it was the right thing I was looking for. There are some things, what I can`t understand. Scene, view, camera, etc…

   

raivispurins, Newbie
Posted: 30 June 2011 07:30 PM   Total Posts: 3   [ # 4 ]

About player. I think, I have instaled newest player 10.3

   

Avatar
Ringo Blanken, Administrator
Posted: 30 June 2011 08:34 PM   Total Posts: 120   [ # 5 ]

Aloha Raivispurins,

To understand it ‘all’, scene, view, camera etc I suggest you to buy the book:
“3D in Flash”, see
http://www.friendsofed.com/book.html?isbn=9781430225416.

Cheers,
Ringo.

 Signature 

Freelancer: http://www.ringo.nl/en/
http://www.jiglibflash.com
http://www.awayphysics.com
http://www.away3d.com

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X