Spherical Panorama

Software: Away3D 4.x

dorkomesher, Newbie
Posted: 03 October 2013 07:32 AM   Total Posts: 2

Hi,
I am trying to create a spherical panorama and map a texture to it. The problem is that when I increase the radius of the sphere, I see a black screen. Something is not right with the camera but I can’t figure it out.

Also, increasing the size of the sphere is causing the texture to pixelate. I am mapping a 2048*2048 jpg image to the sphere.

[Embed(source=”../bin/assets/texture.jpg”)]
public static var PanoBitmap:Class;

var _panoTexture:BitmapTexture =  Cast.bitmapTexture(PanoBitmap);
var _panoTextureMaterial:TextureMaterial = new TextureMaterial(_panoTexture);
_panoTextureMaterial.bothSides=true;
_spherePano = new Mesh ( new SphereGeometry(5000),_panoTextureMaterial);  _scene.addChild(_spherePano);

My Camera properties:
_view = new View3D();
_scene = _view.scene;
_camera = _view.camera;
_camera.lens.far = 10000;
_camera.lens.near = .05;
_camera.y = _camera.x = 0;
_camera.z = 0;
_camera.lookAt(new Vector3D());


not sure where I’m going wrong.

Thanks for the help smile

 

   

Avatar
SharpEdge, Member
Posted: 03 October 2013 11:18 AM   Total Posts: 94   [ # 1 ]

ok considering first that your camera is at 0,0,0 loking at 0,0,0 and that’s not a good definition, but so you want to look at the sphere from inside? To do so you should invert the faces using: MeshHelper.invertFaces(sphere);

   

dorkomesher, Newbie
Posted: 03 October 2013 11:20 AM   Total Posts: 2   [ # 2 ]

Yup, I pulled my camera back by setting z=1.
Doesn’t material.bothSides=true do the same thing as invertFaces?

   

Avatar
SharpEdge, Member
Posted: 03 October 2013 01:00 PM   Total Posts: 94   [ # 3 ]

if you set bothsides it will render on both sides, i don’t know if it has some impact on performance.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X