• What Are You Working On August 2012
    2,271 replies, posted
[QUOTE=Capsup;37219051]Well, they should be atleast. My terrain array is just a 3D array which has the vertices for all my triangles. So that it just goes like this: [img_thumb]http://i.imgur.com/kaeF8.png[/img_thumb] Still, this is what it looks like: [img_thumb]http://i.imgur.com/OChIe.jpg[/img_thumb] Not much better to be honest. So I'm really at a loss about what I'm doing wrong here. I must admit I also wonder what the heck is happening to that couple of completely black triangles there.[/QUOTE] Have you taken into account that for each triangle you need to add the normal 3 times, on the code snipped you posted it seems you only add it once
My latest programming adventure: 1. Open Eclipse 2. See this [IMG]http://i.imgur.com/DyGX5.png[/IMG] 3. Close Eclipse I'm not ready for that tonight. [editline]14th August 2012[/editline] Seriously, it's ass-backwards
[QUOTE=Darwin226;37220286]Are you sure you're attaching those normals to each of those points? This looks like it might be a problem in how you render the terrain in the end.[/QUOTE] It might be, I really don't know. All I do is that I calculate the normals and push them into a vector. Then for my main VBO, I just take one normal from the normals vector per vertex added from the terrain array. [code] for (int z = 1; z < MAP_Z-1; z++) { for (int x = 1; x < MAP_X-1; x++) { vertices.push_back( terrain[x][z][0] ); vertices.push_back( terrain[x][z][1] ); vertices.push_back( terrain[x][z][2] ); vertices.push_back( 0.0f ); vertices.push_back( 0.0f ); vertices.push_back( normals[count].x ); vertices.push_back( normals[count].y ); vertices.push_back( normals[count].z ); elements.push_back( count * 4 ); vertices.push_back( terrain[x+1][z][0] ); vertices.push_back( terrain[x+1][z][1] ); vertices.push_back( terrain[x+1][z][2] ); vertices.push_back( 1.0f ); vertices.push_back( 0.0f ); vertices.push_back( normals[count+1].x ); vertices.push_back( normals[count+1].y ); vertices.push_back( normals[count+1].z ); elements.push_back( count * 4 + 1 ); vertices.push_back( terrain[x][z+1][0] ); vertices.push_back( terrain[x][z+1][1] ); vertices.push_back( terrain[x][z+1][2] ); vertices.push_back( 0.0f ); vertices.push_back( 1.0f ); vertices.push_back( normals[count+2].x ); vertices.push_back( normals[count+2].y ); vertices.push_back( normals[count+2].z ); elements.push_back( count * 4 + 2 ); vertices.push_back( terrain[x+1][z+1][0] ); vertices.push_back( terrain[x+1][z+1][1] ); vertices.push_back( terrain[x+1][z+1][2] ); vertices.push_back( 1.0f ); vertices.push_back( 1.0f ); vertices.push_back( normals[count+3].x ); vertices.push_back( normals[count+3].y ); vertices.push_back( normals[count+3].z ); elements.push_back( count * 4 + 1 ); elements.push_back( count * 4 + 2 ); elements.push_back( count * 4 + 3 ); count++; } } [/code] [editline]13th August 2012[/editline] [QUOTE=Richy19;37220499]Have you taken into account that for each triangle you need to add the normal 3 times, on the code snipped you posted it seems you only add it once[/QUOTE] Nope, not at all. Why would I have to add the same normal 3 times though?
[QUOTE=egomanyak;37220056]I dont get the difference between right and left menu, cant you just move "new stuff" to top of "mice" make your textboxes smaller and put search to top right ?[/QUOTE] Stuff on the right are deliveries, so if you buy 15 mice and they'll be delivered on the 26th of Julvember, once the date is reached it will ask if they've been delivered; it's so you can visualize what you need to order. Not all items need just 5 units though, a super special pen might only need atleast 3 in stock so you can change the priority modifier so that when it's 2 or 1 pen, it appears on the top of the list as expected. So, for example, starting up the program after the date passed: [img]http://i.imgur.com/VyVMf.png[/img] I clicked no, so it will ask me tomorrow instead: [img]http://i.imgur.com/gzkng.png[/img] The items on the left are the actual items we have, they track history too, so you can see what you have done to it in the past: [img]http://i.imgur.com/2CnDG.png[/img] [img]http://i.imgur.com/u8xAH.png[/img] The options so far for each stock item are: [img]http://i.imgur.com/JXkgZ.png[/img] Does that explain it? The bar at the top searches the relevant section; clicking new creates a new one with the name you searched for, but I also want to be able to search history for anything (such as a name), I don't know where to put the button so it won't look like crap.
[QUOTE=Capsup;37220767]Nope, not at all. Why would I have to add the same normal 3 times though?[/QUOTE] Because when you pass stuff to the shader to be drawn you pass them as a vertex not as a triangle, meaning you will need to pass the normal 3 times or better said add the normal to the normal list 3 times
Source doesn't have working intellisense in VS2010 or am I doing something stupid?
[QUOTE=Map in a box;37221090]Source doesn't have working intellisense in VS2010 or am I doing something stupid?[/QUOTE] Source doesn't play nice with IntelliSense for certain things, but it does work for the most part in VS2010. Better so than in previous versions.
Doesn't work at all for me. Guess it hates me, considering I can't even think about compiling the swarm sdk with 08. I've only been able to get the allied modders OB sdk to compile but my friend has perfect intellisense and it compiles 100% for him. I guess as they say, it hates me :V
[QUOTE=Map in a box;37221429]Doesn't work at all for me. Guess it hates me, considering I can't even think about compiling the swarm sdk with 08. I've only been able to get the allied modders OB sdk to compile but my friend has perfect intellisense and it compiles 100% for him. I guess as they say, it hates me :V[/QUOTE] [url]https://developer.valvesoftware.com/wiki/Compiling_under_VS2010[/url]
I don't think resolving those issues aids in IntelliSense working, but they are things that need to be taken care of in the first place.
I said that my friend has it compiling 100% and we're both using same source/project file. Alien Swarm compiles (or should) out-of-box.
I wrote an article about my old physics platformer game. It covers the creation of my custom physics engine, where it failed, and how it survives today. Check it out, you may find it interesting :) [url]http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-one/[/url] [IMG]http://i.stack.imgur.com/OZZp1.gif[/IMG]
Have my adopted babbeis [editline]13th August 2012[/editline] Read that entire article, was a fun read [editline]13th August 2012[/editline] Anxious for part 2!
I think anyone wanting to make a platformer has run into that Box2D issue. They should really just fix it instead of making people use chains and stuff.
That's exactly what I try to develop right now! I started to create/invent a game, too. And I'm inventing a Collision/Physics-System just like you. Pictures will follow. ;)
[QUOTE=ZenX2;37225106]I think anyone wanting to make a platformer has run into that Box2D issue. They should really just fix it instead of making people use chains and stuff.[/QUOTE] That's not a problem with Box2D, that's a problem with physics engines in general. You can't create tight controls with a physics engine. Although, I wonder what Source uses to keep the player controls tight while also running a physics engine...
[QUOTE=Richy19;37219163]Or use Linux/Lubuntu and sudo shutdown, and be able to close your lapop lid without it sleeping :v:[/QUOTE] You can also set Windows to not sleep when closing the laptop lid, and Windows' shutdown command also takes a timer. It's just that the timer is in seconds and this translates h/m/s to seconds.
Finishing my senior project by 2PM EDT. Hope I pass so I can graduate! Streaming: [URL]http://twitch.tv/TehBigA[/URL] All done streaming for now
[QUOTE=Richy19;37220900]Because when you pass stuff to the shader to be drawn you pass them as a vertex not as a triangle, meaning you will need to pass the normal 3 times or better said add the normal to the normal list 3 times[/QUOTE] He's doing it right. You push one normal per vertex.
[QUOTE=Darwin226;37228474]He's doing it right. You push one normal per vertex.[/QUOTE] Yeah, that's what I thought too. The other thing sounded really illogical to me. I'd be more than happy to provide you my entire source, if you'd like Darwin. I just really want to get this to work, but after 2 days of hair pulling, I just don't have much hair left. :v:
[QUOTE=SupahVee;37221724]I wrote an article about my old physics platformer game. It covers the creation of my custom physics engine, where it failed, and how it survives today. Check it out, you may find it interesting :) [url]http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-one/[/url] [IMG]http://i.stack.imgur.com/OZZp1.gif[/IMG][/QUOTE] That was a really interesting read, it brings back memories of our many steam conversations trying to get it working! You've inspired me to do some more work on my platformer, as well.
[QUOTE=Capsup;37228521]Yeah, that's what I thought too. The other thing sounded really illogical to me. I'd be more than happy to provide you my entire source, if you'd like Darwin. I just really want to get this to work, but after 2 days of hair pulling, I just don't have much hair left. :v:[/QUOTE] I might take a look if you do. And don't worry, hair isn't a requirement for programming.
[QUOTE=Darwin226;37228906]I might take a look if you do. And don't worry, hair isn't a requirement for programming.[/QUOTE] Not sure what the easiest way to share is, but here's the code and my project file atleast: [URL]https://dl.dropbox.com/u/40398697/ShareX/2012-08/upEngine.zip[/URL] And thanks alot for the help so far. :)
[QUOTE=Dlaor-guy;37227214]That's not a problem with Box2D, that's a problem with physics engines in general. You can't create tight controls with a physics engine. Although, I wonder what Source uses to keep the player controls tight while also running a physics engine...[/QUOTE] It's a separate system from the main physics if I remember correctly. You should be able to come somewhat close with separate directional damping and friction relative to the (intended) movement direction and by adjusting damping based on player input.
[QUOTE=Capsup;37229058]Not sure what the easiest way to share is, but here's the code and my project file atleast: [URL]https://dl.dropbox.com/u/40398697/ShareX/2012-08/upEngine.zip[/URL] And thanks alot for the help so far. :)[/QUOTE] I think I know where the problem is. In the part where you populate the vertices vector you use XZ, X+1Z, XZ+1 and X+1Z+1 but the normals you use for each of those are not attached to those points on the map in any way. Imagine this gird [code] ABCDEF GHIJKL [/code] You are pushing in the coordinates of ABG and H but normals of ABC and D. Then for the next quad you use BCHI but the normals of BCDE. That's my understanding of your code anyways. Also, what I found strange is that you construct quads in the vertices vector but later on you render as triangles. Thought I admit, I didn't look through the whole thing if you do some extra transformations to it later, you did load that quad filled vector into the buffer.
[img]http://veegamedev.files.wordpress.com/2012/08/shooterlol4.gif?w=545[/img] Hey everyone, I'm glad you found my first article about collisions interesting. I've finished writing the second part, that you can find here: [url]http://veegamedev.wordpress.com/2012/08/14/getting-2d-collisions-right-part-two/[/url] It explains how collision detection and resolution is done in my simple 2d collision engine. It is full of code and easy-to-understand diagrams, along with some .gifs of my older projects. It also contains links to my GitHub page, where all the source code is freely available. Check it out! :D
[QUOTE=Darwin226;37229835]I think I know where the problem is. In the part where you populate the vertices vector you use XZ, X+1Z, XZ+1 and X+1Z+1 but the normals you use for each of those are not attached to those points on the map in any way. Imagine this gird [code] ABCDEF GHIJKL [/code] You are pushing in the coordinates of ABG and H but normals of ABC and D. Then for the next quad you use BCHI but the normals of BCDE. That's my understanding of your code anyways. [/QUOTE] You're right, I didn't actually think of that. Thanks. All that time, and it's such an easy fix... [img_thumb]http://i.imgur.com/HhmQS.jpg[/img_thumb] Now I just need to get my shader working properly. Not sure if the normals are correct, though? [img_thumb]http://i.imgur.com/gq3bT.jpg[/img_thumb] [QUOTE=Darwin226;37229835] Also, what I found strange is that you construct quads in the vertices vector but later on you render as triangles. Thought I admit, I didn't look through the whole thing if you do some extra transformations to it later, you did load that quad filled vector into the buffer.[/QUOTE] Well, I've always been told to use triangles rather than quads, so that's why I do it like that. But if there's a better way to render them, do tell?
[QUOTE=Capsup;37230050]You're right, I didn't actually think of that. Thanks. All that time, and it's such an easy fix... [img_thumb]http://i.imgur.com/HhmQS.jpg[/img_thumb] Now I just need to get my shader working properly. Not sure if the normals are correct, though? [img_thumb]http://i.imgur.com/gq3bT.jpg[/img_thumb] Well, I've always been told to use triangles rather than quads, so that's why I do it like that. But if there's a better way to render them, do tell?[/QUOTE] Well, it does look correct. I think. As for the quads thing, you're right. You should render triangles instead of quads because quads are deprecated, the thing is, when you tell GPU to render triangles it expects sets of 3 vertices, when you tell it to render quads it expects sets of 4 vertices. If you make your buffer contain quads (4 vertices) and render triangles from that then the last vertex in the first set will be the first vertex of the next set and... well. The thing is, it appears to be working just fine so I don't know about that...
[QUOTE=Darwin226;37230544]Well, it does look correct. I think. As for the quads thing, you're right. You should render triangles instead of quads because quads are deprecated, the thing is, when you tell GPU to render triangles it expects sets of 3 vertices, when you tell it to render quads it expects sets of 4 vertices. If you make your buffer contain quads (4 vertices) and render triangles from that then the last vertex in the first set will be the first vertex of the next set and... well. The thing is, it appears to be working just fine so I don't know about that...[/QUOTE] If possible, it's always best to conform to standards and avoid deprecated methods.
[QUOTE=Darwin226;37230544]Well, it does look correct. I think. As for the quads thing, you're right. You should render triangles instead of quads because quads are deprecated, the thing is, when you tell GPU to render triangles it expects sets of 3 vertices, when you tell it to render quads it expects sets of 4 vertices. If you make your buffer contain quads (4 vertices) and render triangles from that then the last vertex in the first set will be the first vertex of the next set and... well. The thing is, it appears to be working just fine so I don't know about that...[/QUOTE] I'm using elements so that's why I put in vertices of 4, but get 2 triangles. Triangle 1 = element 0, 1, 2 and triangle 2 = element 1, 2, 3. So I'm pretty sure it should be correct..?
Sorry, you need to Log In to post a reply to this thread.