-
Zombie Coder
Hey the King of FlashKit is at it again!
Nice demo, the first one reminds me of GoldenEye on the N64.
I'm a little curious why you wrote a custom 3d format instead of reading in 3ds files, if I remember correctly (probably not) you already had a home-made engine for parsing 3ds files into Flash didn't you?
It's a tired old question but do you have any plans for implementing biped support? Would love to see some keyframe animations on little Link there.
-
thx guys
Originally Posted by rachil0
Totally cool demo! Hadn't seen that little green guy in a few years, glad to see he's working on some new projects
well not officially- I just grabed him from somewhere.
@EvilKris: regarding the custom file format: because it has 1/2 the filesize of *.3ds its even way smaller as any other default export format.
On this page I did a comparison with a default teapod (1024 triangles + UV map):
*.3d = 18.2 KB = my format,
*.obj = 66.7 KB = alias wavefront format
*.3ds = 31.5 KB = 3d studio export format
And yes I wrote once a ASE parser (3dsmax ASCI exchange format, used for example in the Unreal engine). But the problem with parsing (converting String into arrays with numbers) is that the filesize is to big and the parsing time takes to long even with AS3.
right now I´ve written a maxscript wich looks like this in 3dsmax:
I just need to select the mesh I want to export and hit the "write file" button,- it happens instantly and I can switch back to flash and reload the mesh. It´s such a time saver for all the testing so propably another reason for me.
As for biped,- no instead I want to use a similar model as we have in flash wich is keyframes tweened into each other. So my idea is to write another maxscript that checks wich vertices moved between the current keyframe and the last one and store their relative movements (like vectors) into that keyframe.
Back in flash I then have an array of states (frames, e.g stand, crouch, lean,...) in wich I can switch or tween via vertex tweening. I hope that this will also resolve into smal file sizes.
Bone stuff is highly complex math stuff wich I dare to touch right now- I rather want progress for now.
-
-
Senior Member
I sat down today and decided to rewrite my (lousy) engine to use bitmapdata instead of drawing api. But I ran into a problem. How did you copy a triangle from the UV image into the surface bitmapdata?
-
Originally Posted by ihoss.com
But I ran into a problem. How did you copy a triangle from the UV image into the surface bitmapdata?
using bitmapData and beginBitmapFill(); it looks somewhat like this:
mc.graphics.beginBitmapFill( bitmapTextureSlice, newMatrix,...);
mc.graphics.moveTo(a.x,a.y);
mc.graphics.lineTo(b.x,b.y);
mc.graphics.lineTo(c.x,c.y);
mc.graphics.endFill();
It works just like you would do before like drawing solid colored triangles but instead with Bitmap Data and a given transformation matrix.
The key is to calculate the Matrix to transform the bitmapFill (you can skew, rotate, scale, translate,...) so that it fits in the end perfectly within the to be drawn triangle. I managed to calulate just the matrix in 1 go and not so complicated anymore like I did in the past. can I PM you a snippet of a texture slice demo I wrote at first.
-
So are you programming this in flash, or using another program, then porting it?
-
as3,- just some xtra tools to get the Data into Flash with maxscript. So one could say the engine and game in Flash- the editor in 3dsmax
-
Senior Member
Oh, I thought you drew everything to one bitmapdata object that you attached to an mc? I thought that would be faster.
One more question: How do you get rid of the white lines along the edges of the object? No matter what I do, they are there!
-
When you integrate, can you import the lightsource data from your background image to use for shading your 3d objects? It's not much extra data compared to the increase in quality you might get.
-
Originally Posted by JerryScript
When you integrate, can you import the lightsource data from your background image to use for shading your 3d objects? It's not much extra data compared to the increase in quality you might get.
not directly - I mean I did not write any shading in flash or per pixel lightning. What I can do however is to bake the lights into the texture (in 3dsmax)- wich looks like the rendered thing but still can be lowpoly and realtime. It´s the same I did with link in the demo before, or here in the past.
The con is that it doesn´t work so well with rotating objects as their baked shadow then wouldn´t work on the other angles you can see the object (in terms of matching the background ones). But if you set the light for the object somewhat general like on top of it it´s not such a big deal.
here is a link for how it works in 3dsmax
-
Guys, I'm not sure how you are doing this, but if you are using a square lense and then finding the intersect points from the lense to the eye, there is a much more efficient way of doing it. I made an engine recently that uses a round lense on a polar coordinate system. All that you have to actually do is measure the difference in angle from where the eye is facing and the points, and while some of you may think that this makes it distorted, it actually is probably better because is visualizes more like the human eye.
adventuresofjoel.com/3d%20demo.swf
Controls are Arrows to move.
A and D to rotate the camera.
The FPS meter goes up to 250, but I've been told that it is correct. If you want more info on it, here is the thread for it:
https://www.mochiads.com/forum-pub/c...#Comment_14767
Last edited by Al Capwn; 03-08-2008 at 11:37 AM.
America!
-
-
just to clarify some of what I brought into this thread
Q: how do I get the camera position into Flash?
A: either copy paste all the attributes of the camera (positionX, positionY, positionz, rotationX, rotationY, rotationZ, Field of View, ScreenWidth, ScreenHeight) or use maxscript and generate Actionscript code, XML files or anything Flash can handle. Like this maxscript I wrote:
Code:
rollout getCameraInfo "grab Camera info" width:192 height:275
(
button btn1 "grab cam info" pos:[3,4] width:77 height:20
edittext info "" pos:[-1,28] width:185 height:105
edittext output "" pos:[-1,150] width:185 height:65
label lbl1 "Actionscript:" pos:[4,135] width:121 height:14
on btn1 pressed do
(
camObj = selection[1]
if superClassOf camObj == camera then (
camPyr = Pyramid widthsegs:1 depthSegs:1 heightsegs:1 width:100 depth:100 height:100
camPyr.transform = camObj.transform
camPyr.wirecolor = color 0 255 0
x = camPyr.pos[1];
y = camPyr.pos[2];
z = camPyr.pos[3];
fov = camObj.fov;
w = renderWidth as Integer;
h = renderHeight as Integer;
rx = floor( camPyr.rotation.x_rotation *10000)/10000;
ry = floor( camPyr.rotation.y_rotation *10000)/10000;
rz = floor( camPyr.rotation.z_rotation *10000)/10000;
delete camPyr;
info.text="cam: "+w as String+" x "+h as String+"\t FOV: "+fov as String+" °";
info.text+="\nx\t"+x as String+"\ny:\t"+y as String+"\nz:\t"+z as String;
info.text+="\nrx\t"+rx as String+"\nry:\t"+ry as String+"\nrz:\t"+rz as String;
clipb="var cam:Camera = new Camera("+x as string+","+y as string+","+z as string+","+fov as string+","+w as string+","+h as string+");";
clipb+="\ncam.x="+x as string+";cam.y="+y as string+";cam.z="+z as string+";";
clipb+="\ncam.rx="+rx as string+";cam.ry="+ry as string+";cam.rz="+rz as string+";\n";
output.text=clipb;
)
)
)
try (-- close existing rolloutFloater
closeRolloutFloater camFloater;
) catch ()
camFloater = newRolloutFloater "set hjs 4" 226 320
addrollout getCameraInfo camFloater;
I made a tutorial on how to run maxscripts here. Once evaluated it looks like this:
select your camera and hit the "grab cam info" button- it will display you then the camera properties you need
Q: what is texture baking and what is the difference between texture baking and rendering?
A: texture baking is also rendering but instead of a perspective correct image you get the textures of the object with rendered results. You could say that it is like a 2D renderer because there is no perspective in the baked texture. It´s used alot in the so called nextGeneration development to conceal the lack of real power and instead display something that looks like a movie (Gears of War is a good example of this [wich is done as well in 3dsmax regarding the render to texture stuff].
So all in all it is very powerfull to imply something high quality render alike with way less reatime performance wich I think flash fits also into.
Here is a comparison of the zelda character I used before in a demo:
The first part shows how a rendering from max looked like (from the viewport). After that I selected the Zelda character and baked a complete Map (wich means that the difuse = color pass, shadows, reflections,ect. all went into the rending process). As you can see it has the same lighting and shadows as the rendering on the very left.
After that I took the mesh and the rendered texture (baked texture) and loaded booth in my 3d engine inside flash. On the last part you have link again but wihout the texture baking process- he just has his dafault textures without much shading at all.
hope that answered some of what people asked here before
-
just a little variation
demo
- rather difficult angle
- mix between lighting layer and difuse layer - so you dont get less anoying shadows on top of the character
some other ideas to easy get lighting and shadow informations on objects are rendering a floor lighting texture and pick in flash the color on wich the character stands (within the top view). With that color then color tint the object slightly. Con: the object or character will be shaded with 1 tone overall.
-
Senior Member
Render, I tried bitmapData.draw, but it was not nearly fast enough, so I tried with beginBitmapFill, and it was a lot faster.
I also rewrote the code so that each face is not stored in a separate bitmapData, but is mapped straight from the uvMap every frame, and that got rid of the lines (for now, it's not complete yet).
The last demo was a bit slow with the character. The rest moved nicely.
-
Nice lighting technique. I had been thinking of just including lighting vectors (normals and magnitude), and then creating interior dropShadows on the faces based on the face normal and the lighting vector. Looks like you found a great shortcut that avoids all that! (at least for this type of static environment)
-
Senior Member
Jesus Christ, render this is amazing!
-
Senior Member
while this is great idea, smth is wrong. especially seen in 1st demo7. character almost looks transparent. maybe applying blur to lighting layer could help?
-
like I said- for now it´s more an Idea- I need to find a way or workaround to fix excatly that
-
great work, and thanks for the rendering notes. I am trying to build a 2d rendering engine thats pretty versatile, and they will help greatly...
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
|