-
[Beta] 3D engine
I've been lurking here for a while now and thought I would finally contribute a little.
This is a 3D engine I created for part of a recent school project. It has simple shading and can read OBJ files with help from PHP. point and line Hit detection is also in there but not shown in this demo.
check it out
www.aaronspjut.com/3d_engine/index.html
-
Start a Revolution
hmm, the engine look nice.
-
-= phil =-
reminds me of my 3d attempts...
eh.. looks good =), gets a bit skippy at high speeds, but pretty good!
-
Hoobahh.......very cool man!!! Don't mind me though, Iam a junior member.
-
thanks!
This is what it was used for:
www.aaronspjut.com/projects/beatpoint/index.html
We called it a "multi media instrument". Its basically a experimental thing-a-mujig that makes sounds and looks neat. Sorry if its hard to figure out. The question mark will show instructions.
you can click on the cube in the middle to rotate it.
-
Nice start!
*.obj is a 3D format I assume. Can you explain the PHP thing? Does it read the file and send bitmaps to Flash at runtime?
Thanks alot,
jtnw
-
yep OBJ is a 3D file formate.
There are no bitmaps involved anywhere. Its all drawn with flash's drawing API.
It really sounds a lot cooler than it is. OBJ files are just a list of the points and a list of the faces. A cube looks like this:
v 0 0 0
v 200 0 0
v 200 200 0
v 0 200 0
v 0 0 200
v 200 0 200
v 200 200 200
v 0 200 200
f 1 2 3 4
f 8 5 1 4
f 8 7 6 5
f 2 6 7 3
f 1 5 6 2
f 8 4 3 7
The php just parses that and spits out a string that flash can understand when accessed with loadVariables(). like this:
note: this doesn't match the above OBJ file but its still a cube
"v,-50,-50,-50:v,50,-50,-50:v,50,50,-50:v,-50,50,-50:v,-50,-50,50:v,50,-50,50:v,50,50,50:v,-50,50,50:f,1,2,3,4:f,8,5,1,4:f,8,7,6,5:f,2,6,7,3:f ,1,5,6,2:f,8,4,3,7"
It made for a great presentation at the end of the class. I got to say that my flash engine could read files exported by all the top Modeling software including Maya and Max. Although I wouldn't recommend trying to render a 10,000 poly model with flash
-
Wow, that is simple... nice.
I actually was looking for a way to import 3D objects that were low poly count, this seems to be perfect.
Thanks again,
jtnw
-
hmmm, im working on something simelar. Mine is a vector only 3d engine that i got to run at around 30 fps. I will use it for a tank game and i hope to develop it further into a 3d flying game. I'll put together a neat version of it when i get home (im messing around with colision detection now).
-
-
Here is my php script for loading .obj files//
http://video-animation.com/flash3d_002.shtml
steve
-
You guys seem to know a lot about 3D in flash, so maybe you know how to make relative rotation. By this i mean rotation aorund all axis relative to the cam. For example in a flying game you want to pitch the plane up around the z axis, or roll it around the x axis. Now what about if the plane has turned 90 degrees, then the planes x axis is the worlds z axis, so if you rotate it around the x axis, it will actually pitch. Is there a way of fixing or doing this?
-
free-webmaster-resource.com
hehe hiya steve, before reading your post i was gona post yours
-
*********
the music/beat thing is great! nice one
-
You guys seem to know a lot about 3D in flash, so maybe you know how to make relative rotation. By this i mean rotation aorund all axis relative to the cam. For example in a flying game you want to pitch the plane up around the z axis, or roll it around the x axis. Now what about if the plane has turned 90 degrees, then the planes x axis is the worlds z axis, so if you rotate it around the x axis, it will actually pitch. Is there a way of fixing or doing this?
I like to think of it as rotating the entire world in front of a stationary camera. So base all objects in the scene from one main scene origin. Then rotate, translate, manipulate, the scene origin to get the view you want. A camera would be a saved position of the scene origin.
-
The way i do it is that i store the cams position in the world, then find the difference between an object and the cam. What about for other objects. if i rotate something 45' around the x axis then 90' around the y axis, then it will not look the way it should (see my plane example).
-
I think your getting into Gimble lock territory a problem of Euler angles. Quaternions are one method of avoiding this. Although I haven't implemented this yet so all I can do is provide the links.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|