Pseudo 3d? Forum Home > Construct 2 General > How do I....? |
Post Reply
|
Page <123> |
| Author | |
Post Options
Quote Reply
Posted: 19 May 2012 at 1:14pm |
|
|
thats an amazing effect, works really well
we need a more in depth tutorial to understand this...... pretty please? |
|
![]() |
|
Post Options
Quote Reply
Posted: 19 May 2012 at 4:57pm |
|
Hers a pretty cool example I came across- ![]() The code is not mine, I only made the textures! Test This was created by Ben Joffe. Here's a link to his site- Website
|
|
|
http://www.youtube.com/user/johnbrobs
|
|
![]() |
|
Post Options
Quote Reply
Posted: 19 May 2012 at 7:07pm |
|
|
Thanks again @r0j0hound! I figured out that 2nd example and updated my demo in the creations folder. I like the 2nd example a lot. Using lines to create the walls was a great idea
|
|
![]() |
|
Post Options
Quote Reply
Posted: 19 May 2012 at 7:40pm |
|
|
@darksteeldanger
The first post I made in this topic has a link that explains it somewhat. Basically what I did is make a top view game. Then I made a sprite for each vertical line across the screen. Then the player on the top view shoots a spread of bullets, one for each vertical line. When a bullet hits a wall then the corresponding vertical slice is made visible and it's height is set to 100*1/distance(bullet, player). For the 2nd example I used the math here to find more precise wall intersections. http://paulbourke.net/geometry/lineline2d/ For the texture I first split it into a frame per vertical slice. Then when the bullet(or ray) hits a wall I calc what texture slice to use by where on the line is hit. New version with more fixes: * multiple textures * commented * changed walls from lines to polygons. http://dl.dropbox.com/u/5426011/examples11/raycast3.capx |
|
![]() |
|
Post Options
Quote Reply
Posted: 19 May 2012 at 8:02pm |
|
|
oh nice that version is well done too! amazing!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 20 May 2012 at 1:44am |
|
|
Stop this awesomeness! It is too much!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 25 May 2012 at 8:42pm |
|
|
Im very tryin to figure out how to show walls behind other walls for things like half high walls and windows etc so far the only thing I can get to work is separatin the special walls from the other walls then rendering both sets but it KILLS performance makin it pretty much unplayable with any number of slices that looks decent
Any one got any ideas about how it could be done? I can post an example of how Im doin it currently if anyone wants to lag thru it to see what I mean lol |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 May 2012 at 9:02pm |
|
|
I imagine it would kill the performance. Right now only the first wall hit per cast ray is used. It can be changed so that a order list of walls hit is used, which shouldn't affect performance too much.
The bottleneck will be the rendering. Right now one sprite is used for each vertical slice. With half walls more than one sprite will be needed per slice. I thought of using only 1 sprite and pasting it many times to a canvas object for the drawing, but I'm not sure if that would improve performance. |
|
![]() |
|
Post Options
Quote Reply
Posted: 27 May 2012 at 6:16pm |
|
|
i cant think of any other way to do it. the only other thing to do would be have textures for each upper and lower wall combination but that doesnt take distance between the two into account
|
|
![]() |
|
Post Options
Quote Reply
Posted: 27 May 2012 at 7:31pm |
|
|
@aridale
I don't think that a combi texture would work, because you'd have to take into account all possible combinaison of height between the seethrough wall and the wall behind... |
|
![]() |
|
Post Reply
|
Page <123> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |