<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm trying to get a phong shaded plane to work,
with a 200x200 jpg applied to it, pretty simple I thought, but I keep running up
against this error - </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Error #1007: Instantiation attempted on a
non-constructor.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>which seems to be something to do with my trying to
create a new instance of myBitmap(); code below, can you tell me what I'm doing
wrong? bitmap.jpg resides in the root of ny web directory</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Courier size=2>package {</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier size=2> import
flash.display.Bitmap;<BR> import flash.display.Sprite;<BR> import
flash.events.Event;</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier size=2> import
org.papervision3d.lights.PointLight3D;<BR> import
org.papervision3d.cameras.*;<BR> import
org.papervision3d.objects.primitives.*;<BR> import
org.papervision3d.materials.*;<BR> import
org.papervision3d.materials.shaders.PhongShader;<BR> import
org.papervision3d.materials.shaders.ShadedMaterial;<BR> import
org.papervision3d.render.*;<BR> import
org.papervision3d.view.*;<BR> import
org.papervision3d.scenes.*;<BR> import
org.papervision3d.view.BasicView;<BR> <BR> </FONT><FONT
size=2><BR><FONT face=Courier> public class myGallery extends Sprite
{</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> private var viewport:Viewport3D = new
Viewport3D(0,0, true,true);<BR> private var
renderer:BasicRenderEngine= new BasicRenderEngine();<BR> private var
scene:Scene3D = new Scene3D();<BR> private var camera:Camera3D = new
Camera3D();</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT
face=Courier> [Embed(source="bitmap.jpg")]<BR> private var
myBitmap:Class;</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> <BR> <BR> public
function myGallery()
{<BR> initPapervision3D();<BR> }</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> private function initPapervision3D():void
{<BR> viewport = new
Viewport3D();<BR> addChild(viewport);</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> scene = new
Scene3D();<BR> camera = new
Camera3D();<BR> renderer = new
BasicRenderEngine();<BR> var plane:Plane = new
Plane(shadedMaterial);</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> scene.addChild(plane);</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> camera.z =
-500;<BR> <BR> var bm:Bitmap = new
myBitmap();<BR> <BR> var light:PointLight3D = new
PointLight3D();<BR> <BR> var bitmapMaterial:BitmapMaterial
= new BitmapMaterial(bm.bitmapData, true);<BR> var
shader:PhongShader = new PhongShader(light, 0xffffff, 0x000000,
10);<BR> var shadedMaterial:ShadedMaterial = new
ShadedMaterial(bitmapMaterial, shader);</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier> renderer.renderScene(scene, camera,
viewport);<BR> }<BR> }<BR>}</FONT></FONT></DIV></BODY></HTML>