I try to make a website where you can navigate by travelling through a galaxy, but to make things a bit more complicated i try to put a 3d view of it.
After long search i came to the conclusion to use papervision3d.
It is this picture of our Milkyway
http://ddg.trackers-world.net/gal_1280.html
from a different viewing angle
http://ddg.trackers-world.net/galview_side.html
but as you can see, or not see, my picture is not displayed, only the BitmapFileMaterial without the *.jpg, which i put into the same directory as the *.swf, like on my harddrive where i can see it.
Also it seems that the Picture is not rendered correctly, and i found that there is precision texture mapping to view it correctly. but i cant get it to work.
package
{
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.objects.Plane;
import org.papervision3d.scenes.MovieScene3D;
[SWF(width='800',height='800',backgroundColor='0x000000',frameRate='30')]
public class ExampleBitmapFileMaterial extends Sprite
{
private var container :Sprite;
private var scene :MovieScene3D;
private var camera :Camera3D;
private var plane :Plane;
public function ExampleBitmapFileMaterial()
{
container = new Sprite;
container.x = 500;
container.y = 300;
addChild( container );
scene = new MovieScene3D( container );
camera = new Camera3D();
camera.y = -100;
camera.z = -100;
camera.zoom = 7;
// "sig05-010a_1024.jpg" is the picture of the Galaxy
var material:BitmapFileMaterial = new BitmapFileMaterial("sig05-010a_1024.jpg");
material.doubleSided = true;
material.smooth = true;
plane = new Plane( material, 256, 256, 2, 2);
scene.addChild( plane );
stage.addEventListener( Event.ENTER_FRAME, onEnterFrame );
}
private function onEnterFrame( event: Event ): void
{
// render scene
scene.renderCamera( camera );
}
}
}
also, how do i let the picture rotate around its center?