Greetings,
I’m trying to generate a block world where a character moves around.
You might want to view:
http://bscacad2.buffalostate.edu/~klingeta01/wp/flash/bin-releaseNEWEST/phy13.html
To understand what I’m doing.
[Click start, and arrow keys to move, W A S D to move camera, space to jump]
using concepts from:
http://away3d.com/tutorials/Introduction_to_Particles
I’d like to generate my block world. I’ve got it to add the block peices and have it look as the original in the link above, but you can only view it when you look down.
I believe it has to do with the worldMesh being located below the camera, even though subgeometries are being drawn in view? Thus causing the sub geometries to just not draw in that case?
I’d like however for it to draw those subgeometries. Perhaps if there is a way to always render a certain object regardless of being ‘on screen’?
I don’t know what the best way to go about this is.
When you view this:
http://bscacad2.buffalostate.edu/~klingeta01/wp/flash/bin-releaseNEWEST/phy14.html
Press ‘S’ to look down, and the world generates (I’ve kept the animation from the tutorial). You can only view it in this view point, even if it’s drawing cubes else where.
help please,
-B
EDIT:
::::::::::::::::::::::::
Code:
if (worldArray[x][y][z] == 1 && drawIt < 6 && y > 2 && x < 126 && x > 2 && z < 126 && z > 2){
//if all logic passes to determine a drawn cube, well
//place it down.
var point:Vector3D = new Vector3D(x - 0, y - 0, z - 0);
point.scaleBy(15);
data.push(point);
// place_a_new_cube(x,y,z,0,0,0);
}
for (var i:int = 0; i < data.length; i++)
{
geometrySet.push(cubeG);
}
animati ParticleAnimationSet();
//add behaviors to the animationSet
animationSet.addAnimation(new ParticleVelocityNode(ParticlePropertiesMode.LOCAL_STATIC));
animationSet.addAnimation(new ParticlePositionNode(ParticlePropertiesMode.LOCAL_STATIC));
//set the initialiser function
animationSet.initParticleFunc = initParticleParam;
var material:ColorMaterial = new ColorMaterial(0xffffff);
material.alphaPremultiplied = true;
material.lightPicker = _lightPicker;
var particleGeometry:Geometry = ParticleGeometryHelper.generateGeometry(geometrySet);
particleMesh = new Mesh(particleGeometry, planeMaterial);
animator = new ParticleAnimator(animationSet);
particleMesh.animator = animator;
animator.start();
view.scene.addChild(particleMesh);
private function initParticleParam(prop:ParticleProperties):void
{
prop[ParticleVelocityNode.VELOCITY_VECTOR3D] = new Vector3D(r * Math.sin(degree1) * Math.cos(degree2), r * Math.cos(degree1) * Math.cos(degree2), r * Math.sin(degree2));
prop[ParticlePositionNode.POSITION_VECTOR3D] = new Vector3D(data[prop.index].x, data[prop.index].y - 15, data[prop.index].z );
}