dcsimg
A Flash Developer Resource Site

Page 5 of 6 FirstFirst 123456 LastLast
Results 81 to 100 of 108

Thread: [as3][3d] little 3d texturing demo

  1. #81
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    A slight catch on the technical side, is that a curved path might crossover to unwalkable territory even if the linear spline did not. Since you've already padded/enlarged those regions with extra space anyway (Post# 05-30-2008 10:49 PM) , I think it'll be ok.

    You might enjoy this link to deCasteljau's algorithm, it is a pretty elegant geometric-based algorithm for drawing bezier curves.

    http://en.wikipedia.org/wiki/De_Casteljau's_algorithm#Geometric_interpretation

    I'm guessing the path-smoothing algorithm takes place in screen space? One thing that has always bugged me is that (I think) the perspective transform of a bezier curve is not a bezier curve in screen space. However, (I think) a NURBS does map to another NURBS, when perspective transformed. This is only relevant if you're interested in decoupling pathfinding from camera positioning. (IE paths are all precomputed in world space, then projected to various screen spaces depending on which camera is active).

    Cool work

  2. #82
    Senior Member
    Join Date
    Jun 2007
    Location
    Planet Earth
    Posts
    358
    I have an idea for the pathfinding. It seems like you're putting way too much effort into this by running all of the possible calculations, when you could just have a lot of it precalculated.

    Now idk how you're doing this, with OOP or what, but you can basically just add all of the vector points into a matrix, and sort them according to distance. So you'd have an array for each point, that would reference its distance to the other points, and the respective path to be taken. You could precalculate all of this, and even spit it out as an external file if you wanted to, so that it wouldn't have to be recalculated for every user.

    So if your lady starts at node 20 and is moving to node 4, you would simply go to matrix[20][4].path, and return the already precalculated path. You could cut your search time down to nothing.

    The disadvantage: with 92 nodes, you'd have to have 92 x 92 arrays, unless you did it smartly, and only made a single connection between any two points. Eg. You wouldn't have matrix[4][20] and matrix[20][4]
    America!

  3. #83
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    @rachil0: that looks familar,
    but even with that Id not been perfectly helped in the beginning. Math has its own world - and its not easy to get into it.
    Path is smoothed in 3d space,- no cheating even the path that gets executed in the end is in 3d space (x,y,z coordinates) because it matters for the objects or characters to be moved.

    @Al Capwn: I had precalculation experiments in the past but the big con was that they were usually that resource intense that doing so on the client computer would be a pain to wait.
    And if id do it on my computer and store it into arrays its only xtra work that I need to compile each time.
    And like you already said yourself - an amazing big array that would be. Calculating the distance to a near node and comparing if it exceeds the current shortest path is propably faster as accessing a very big array and indexing it on each level load.
    I expect some very complex level collision paths exported from max for each level,- splitting that path up into what I just need for the current perspective works well for now. But thanks anyway for your input it gave me some thoughts.


    some development,

    the filesize made me some worries, knowing that more cameras would be added afterwards each with a color map and a alpha map for the clipping objects. So I had this idea of splitting colors and alpha into 2 separate image files with some advantages:

    I implemented it like this in my xml:
    PHP Code:
    <obj id="mother" url="3d/3d_test_mother.3d" tex="tex/3d_test/3d_test_mother.jpg@3d_test_mother_alpha.jpg" ani="ani/mother.ani"/> 
    the textures are assigned at 'tex'- a '@' sign splits them and tells my class that a seperate texture for the alpha channel is used. The path gets automaticly fixed if in the 2nd parameter the folder for example is missing.
    If they have different sizes the alpha channel gets resized to the size of the color map.

  4. #84
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    have you tried making the images 8 bit
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  5. #85
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    that wont give me the nice soft gradient in the alpha channel,- wont it?

    its not like Ill be using it for all textures or sprites just where it makes sense and I think that especially with the camera textures it will be very useful.

  6. #86
    Senior Member bomesar's Avatar
    Join Date
    Nov 2006
    Location
    Croatia
    Posts
    136
    @ renderhjs
    Man I could swear I saw some wicked level design screenshots a couple of hours ago
    "Kreativa Studio - Izrada Flash Stranica"

    LATEST: Flash - Mareda Potrčko HTML - Mikrofonija New Layout Design - Tony Robbins || SOCIAL: on Twitter on Facebook on Kontain

  7. #87
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    that wont give me the nice soft gradient in the alpha channel,- wont it?
    8bit anti aliased .png files do a pretty good job of it.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  8. #88
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    I thought in PNG 8bit as a total means a indexed palette with a maximum of 256 colors, whereas if I take transparency just like GIF I have only a aliased alpha map (pixelart style) - or did I missed that wrong wit PNG?.
    because usually I need to store it as 32 bit ARGB ([8]bit each channel = 24 color + 8 bit alpha), would be nice of couse if I could store the alpha as 8bit or less with indexed palette and colors as well.

  9. #89
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    8bit anti aliased .png will give you 256 colours some of which will be used to feather the edges.
    why do you need transparency anyway?
    the model should naturally crop the image shouldn't it?
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  10. #90
    Senior Member
    Join Date
    Jun 2007
    Location
    Planet Earth
    Posts
    358
    Regarding the precalculation...

    If you precalculated it, and then stored it all as an XML file, you wouldn't have to compile it, and it would take very little actual space (a few kb, at most);

    And the arrays might be really big, but the actual amount of memory it would consume would be very little. Even if it took up 100mb (I doubt it would even take 1), most computers these days have at LEAST 512mb, and referencing from memory is significantly faster than actually calculating the results (bitmap vs vector)
    America!

  11. #91
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    well perhaps the example is not the best (mother character) but in her case she needs it for her hair.
    A better example are the lights in the renderings,- some of the lights will overlap the character - soft gradients are a must there.

    updated demo:


    online demo

    changes:
    - smoothed path
    - pathfinding minor fixes
    - alpha map of the mother is separate loaded
    - texture baking test with the textures of the 3d character
    - dark blur while pause
    - demo filesize: 338 KB (!html)
    - quickturn key: just some testing (space is btw. picking up)

    textures in use:

  12. #92
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    why not post your (32bit transparent) image and i'll have a go at converting it to 8bit?
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  13. #93
    Senior Member bomesar's Avatar
    Join Date
    Nov 2006
    Location
    Croatia
    Posts
    136
    Think I found some bugs...
    The first one is when you click like 10 pixels above point 14 your character keeps walking in some direction (depending where you came from), sometimes (mostly) even off screen and I can't get it back. Use camera 2.
    The second one happens when returning from point 14, your character always does an unnecessary quickturn on point 13. Maybe it's about the unlucky number 13 but I think it's math after all
    Other that that just a lot of nice thoughts about this project you already heard.
    "Kreativa Studio - Izrada Flash Stranica"

    LATEST: Flash - Mareda Potrčko HTML - Mikrofonija New Layout Design - Tony Robbins || SOCIAL: on Twitter on Facebook on Kontain

  14. #94
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    915
    Ive been playing with B-Splines and Subdevisions before but honestly never really understood the math of them
    Try these formulas, I'm pretty sure they work. Specifically, C.R. spline is great for path smoothing, it would look somewhat like this in your case:
    who is this? a word of friendly advice: FFS stop using AS2

  15. #95
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    915
    p.s. I wanned to ask this since forever... what's with their eyes? looks like bad solar bath attempt.
    who is this? a word of friendly advice: FFS stop using AS2

  16. #96
    Flash Genie letschillout's Avatar
    Join Date
    Feb 2007
    Location
    31.52949, 74.347272
    Posts
    146
    gr8
    Charag - 3D, Flash Games, Animations,
    Website Development & More...


  17. #97
    Senior Member The Helmsman's Avatar
    Join Date
    Aug 2005
    Location
    _root
    Posts
    450
    Nice work!
    Last edited by The Helmsman; 01-05-2009 at 04:35 AM.

  18. #98
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    my first post in a long time,

    I added a youtube video upload:
    http://www.youtube.com/watch?v=71Xw3wVcQ88
    that covers basically all the engine stages and the final demos I showed here at my university but did not uploaded for technical reasons.

  19. #99
    formerly hooligan2001 :) .hooligan's Avatar
    Join Date
    Mar 2008
    Posts
    405
    Wow render that's impressive as. Game looks really interesting.
    World Arcade | Facebook | Twitter - Follow MEEEE! or not......

  20. #100
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    915
    yay carrot pong!
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center