, Jr. Member
Hey guys,
Sorry for the late replay. As this is a Independent Project for school I wouldn’t mind staying with non-platform strictly new flash players. But I also don’t want to take the easy way out.
I’ve been spending so much time trying to make my own 3D game (with zero knowledge of 3D programming) that I find my self so swamped.
What I’m trying to do:
I generate a world made of cubes (like mine craft) and the user can walk around and ‘harvest’ the cubes and replace them as they please.
When the user walks farther into the world, I need the world to render with him. At the same time I need to un-render what he is too far away from. Since it will need to render a LOT of cubes every step the user takes in a specific direction, I was thinking of a way to do it in real time.
My system right now is kind of funny. I generate a terrain with the terrain function (which might be away physics) and I use the getheightmap function to store the y axis.
I cycle through my 3-D array and draw cubes using the y-axis data from the terrain map. I then merge my many cubes into 1 ‘world’ object.
In order to keep mouse interaction on a per-cube basis, I figure my character will only need to be able to click on maybe the first 30 cubes near him. So I create 30 cubes that mimic the size, location and texture of the cubes merged into the ‘world’ object, and just re-use these temporary 30 cubes as I walk around, or harvest cubes up. So in reality I’m causing 31 objects to be drawn to the screen.
So when you click a temporary cube to harvest it I set the vertexdata corresponding to my cube in the world object to null (if this really deletes properly I don’t know).
ex:
FinalMesh.geometry.subGeometries[1].vertexData[i*3] = null;
FinalMesh.geometry.subGeometries[1].vertexData[(i*3)+1] = null;
FinalMesh.geometry.subGeometries[1].vertexData[(i*3)+2] = null;
So when I walk around, having something draw the cubes without locking ujp everything else would be a big help.
Any ideas on my system/threading?
I am in a situation that I don’t know the best way to do things since I don’t really know 3D programming at all (it’s like starting computer programming from scratch).
I attached a pic for visual concept..
Thanks,
WB