|
Hey.
I'm attempting to update what I'd already built from 1.1. to 1.2.
There are a couple of things that I wondered if you could help with...
1)
when I change from a clipscreen to a *standard* movie clip, the camera
*size* is not being maintained - i.e. the scene runs off the side of
the space i want it to go... My code is below, the commented bits are
the ones that were working in 1.1...
// var screen:ClipScreen = new ClipScreen( this.createEmptyMovieClip('screen_mv', 1), 600, 570 );
var screen = _root.createEmptyMovieClip("screen_mv", this.getNextHighestDepth(), 600, 570);
World3D.getInstance().setContainer(screen);
// create camera
// cam = new Camera3D( 700, screen);
cam = new Camera3D(600, 570);
cam.setPosition(_root.camPosX, _root.camPosY, _root.camPosZ)
cam.lookAt(0, 0, 0);
// add the camera to the world
// World3D.getInstance().addCamera( cam );
World3D.getInstance().setCamera( cam );
// create the root node.
bg = new Group();
World3D.getInstance().setRootGroup( bg );
// launch the scene
createScene( bg );
// launch the world rendering
World3D.getInstance().render();
2)
I'm loading some Plane3D's with images on (hopefully) one face. In 1.1
I was able to set the back face culling and a box with a line across it
appeared when the camera moved to the untextured face. This is
precisely what I want to happen, but the 1.2 code is not working the
same...
// set the back-face of the skin to be a *simple* box
// newo.enableBackFaceCulling = false;
newo.enableBackFaceCulling(false);
Is there a change to this functionality? or a different call to make?
3)
The most recent change I made to my application was to implement a
*smooth camera movement* function. This worked perfectly in 1.1, but
the following code doing something very odd with the camera in version
1.2. Again - is there a change to the functionality, or a different
call to make?
// function to move camera to new location
function moveSmoothTo(newX:Number, newY:Number, newZ:Number):Void {
var camEase:Ease = new Ease();
camtrans = new PositionInterpolator( camEase.create(),20,
new Vector( _root.camPosX, _root.camPosY, _root.camPosZ ),
new Vector( newX, newY, newZ ) );
_root.cam.setInterpolator( camtrans );
// when interpolation ends, fire the look at function..
camtrans.addEventListener( InterpolationEvent.onProgressEVENT, this, lookAtIt );
camtrans.addEventListener( InterpolationEvent.onEndEVENT, this, removeMoving );
}
// function to remove moving movie
function removeMoving() {
_root.cam.setPosition(_root.camPosXFinal, _root.camPosYFinal, _root.camPosZFinal);
_root.cam.lookAt(_root.currPosX, _root.currPosY, _root.currPosZ);
}
// function to look at current image
function lookAtIt() {
_root.cam.lookAt(_root.currPosX, _root.currPosY, _root.currPosZ);
}
I've
had a good search through the Wiki and this forum for anything about
the above three issues, and I'm unable to find anything which answers
my queries... any help would be most appreciated.
minor update... when I add
newo.enableClipping( true );
to
the creation of each object, then 1) only becomes a problem with the
vertical dimension of the screen. 2) is still a problem - 1.2 is
rendering both sides of the Plane3D. 3) turns out to be working
perfectly -- it was bits of the other objects coming in front of the
camera somehow... I've attach a screenshot for reference...
Attached thumbnail(s)
Another minor update... it seems the Camera3D(width, height) won't do anything except a "square" based on the first dimension??
i.e. Camera3D(600,570) == Camera3D(600,0) == Camera3D(600,600)
I
think I can easily work around this issue by making my flash canvas
slightly different... so I think I am happy with this as a solution to
issue 1) for now.
so I'm only looking for an answer on 2) the backFaceCulling / enableClipping problem.
Hi,
It's nice that you are finding the solution so tyour problems yourself
The
new dimensions of the camera are really true if the clipping is enabled
with all the worlds objects. This would be the behaviour with a fast
platform, but it's not, so I prefer to let people make their choice.
So
you have to set the correct position of the world container. The
dimensions you give to the camera is the area where the scene will be
drawn. If you augment it, you'll not see more things, but exactly the
same bigger or smaller (and previous version did'nt do that).
Concerning
the problematic second point, I don't see the point... But maybe this
can be a sort problem? Is it an object that is displayed and that
wasn't before? Or a box in a middle of a plane? Because the current 1.2
beta does not allow that. But this will change back soon!
Thanks for the response.
I'm still in error-land tho...
Previously
I created a Plane3D then added a skin to it. When the camera was on the
*not normal* side of the Plane3D, what was rendered was a black square
which was transparent. I've attached two screenshots to highlight this.
The first (screen_1.png) is the 1.1 version, the second (screen_2.png)
is the 1.2 version...
hopefully you now see what I mean?
Attached thumbnail(s)
Oh ok.
This seems to be a back skin problem.
To solve this, try to apply a simpleLineSkin to the plane with setBackSkin( new SimpleLineskin() )
Not sure it will solve (temporary!) the problem, but you can give it a try
Sure it can be
I'll look at it. But even if you specify both setSkin and setBackSkin the problem exists...
What a shame.
Thanks for the report(s) !
I've noticed this problem too!
setSkin and setBackSkin functions in the Object3DClass seem to be copied and pasted.. i think the problem is in the
var l:Number = aFaces.length;
while( --l > -1 )
{
aFaces[l].updateTextureMatrix( _s );
}
part. I tried this code:
// myPlane3D triangulated, quality set to 1
var myPlane3DFaces:Array = myPlane3D.aFaces; // myPlane3DFaces.length returns 2
var faceFront:Object = myPlane3DFaces[0];
var faceBack:Object = myPlane3DFaces[1];
// skin A and B are MovieSkins
faceFront.setSkin(skinA);
faceBack.setSkin(skinB);
... although it didn't work, i still love sandy
... or somewhere in the PolygonClass, suspected functions: updateTextureMatrix, render...
Do you want to have a different texture to both sides?
hehehe, yes i know that was a wrong way...
for a better understanding, here is what i'm working on: http://sandyplayground.vatrobot.com
Ok,
The 1.2 BETA does not support both front and backside textured...
It's temporary don't worry
And I don't see any hack for the moment, unless you want to code this support
Hi Thomas,
I
just noticed this thread regarding backSkin. Is backSkin still not
working in 1.2? Could you give me an idea of whether this will be
supported or is being removed? Also why it might not be working now?
For a plane that I want a front and a back for I guess I need to create 2 planes?
Yeah,
it's a bummer. Having the backface skin different is so convenient. I
too am worried about performance, although I wonder how much different
the performance would be if the both planes had
enableBackFaceCulling(true); But you still have to transform 2 objects
instead of 1 for each plane
Your tutorials are really great.
I
had backfaces working fine in v1.1, unfortunately I'm committed to
using 1.2 for a myriad of other reasons. Any news on an update? And if
one is coming, will backfaces be in it?
I started and am staying with 1.2 Beta testing looking foreward ... trying to figure out why something doesn't work is also a great way of getting more familiar with the engine.
So, here is something else:
correction:
Hello Petit!
I've sent you a link to the files.
Have a look and thanx!
Feel free to change/correct/improve &/or publish code.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)