• What do you need help with? Version 5
    5,752 replies, posted
[QUOTE=Richy19;36168003][code]f 1/1/1 2/2/2 14/3/3 15/4/4 f 2/2/2 3/5/5 13/6/6 14/3/3 f 3/5/5 4/7/7 12/8/8 13/6/6 ...[/code] Ahh the model seems to use quads where as my loader assumes its triangles. Is there any line in the obj file that identifies if its using quads or triangles? I cant find anything in the specification[/QUOTE] Nope, it's based entirely on what you find on that face definition line. Just check for how many vertex references are on each face definition line, then construct an appropriate number of triangles for them.
[QUOTE=Chris220;36168014]Nope, it's based entirely on what you find on that face definition line. Just check for how many vertex references are on each face definition line, then construct an appropriate number of triangles for them.[/QUOTE] Sweet got it working, neither the car nor the trees worked earlier :DDD [IMG]http://i.imgur.com/sfelB.png[/IMG]
Congratulations! :)
So here's an odd one. My terrain is sort of... half transparent. Its kind of hard to describe. [img]http://puu.sh/ypjQ[/img] Anyone know what might be causing this?
I'm not sure what you are trying to show but do you have depth test on?
[QUOTE=WTF Nuke;36174020]I'm not sure what you are trying to show but do you have depth test on?[/QUOTE] Yes it is, and what I'm trying to show is how for some reason the parts that are behind the mesh are being drawn on top of whats in front. So if you were standing five feet from the edge of a cliff you would see through the ground and the cliff face to the base. I do have depth testing setup as well.
I've used TortoiseGit for using git on Windows. Unfortunately it has no portable version that i could put on a USB drive. Is there a portable program for using git on Windows?
[QUOTE=sim642;36178213]I've used TortoiseGit for using git on Windows. Unfortunately it has no portable version that i could put on a USB drive. Is there a portable program for using git on Windows?[/QUOTE] You can install Linux on the usb drive, then boot up into Linux whenever you need git. :v: I'm actually pretty serious; I was sick of dealing with school computers so I just bring my own OS to develop in on them. It feels nice knowing all of your work is saved on git as well as in your pocket, leaving the host computer untouched.
[QUOTE=sim642;36178213]I've used TortoiseGit for using git on Windows. Unfortunately it has no portable version that i could put on a USB drive. Is there a portable program for using git on Windows?[/QUOTE] I found out that GitForWindows has a portable version so I'm going to use that currently.
[QUOTE=sim642;36178772]I found out that GitForWindows has a portable version so I'm going to use that currently.[/QUOTE] I guess someone is not feeling adventurous today. :(
When building the model matrix, what is the correct order to do the rotation, scaling, translation? Also if I what to rotate 2 axis by different degrees in glm I need to perform 2 different rotations, does it matter what order I rotate them?
[QUOTE=Richy19;36182793]When building the model matrix, what is the correct order to do the rotation, scaling, translation? Also if I what to rotate 2 axis by different degrees in glm I need to perform 2 different rotations, does it matter what order I rotate them?[/QUOTE] My matrices are generated like this: [code]glm::mat4 Pos = glm::translate(glm::mat4(),Position); glm::mat4 Ang = glm::rotate(glm::mat4(),Angle.z,glm::vec3(0,0,1)); Ang = glm::rotate(Ang,Angle.y,glm::vec3(0,1,0)); Ang = glm::rotate(Ang,Angle.x,glm::vec3(1,0,0)); glm::mat4 Sca = glm::scale(glm::mat4(),Scale); Matrix = Pos*Ang*Sca;[/code]
[QUOTE=Richy19;36182793]When building the model matrix, what is the correct order to do the rotation, scaling, translation? Also if I what to rotate 2 axis by different degrees in glm I need to perform 2 different rotations, does it matter what order I rotate them?[/QUOTE] It depends on if you're using row-major or column-major. Whatever it is in DirectX (D3DXMATRIX) is backwards from whatever it is in OpenGL/GLM (glm::mat4)
[QUOTE=Lord Ned;36184678]It depends on if you're using row-major or column-major. Whatever it is in DirectX (D3DXMATRIX) is backwards from whatever it is in OpenGL/GLM (glm::mat4)[/QUOTE] How do you mean? I know GLM mat4 are mat4[column numb][row numb]
[QUOTE=Richy19;36184696]How do you mean? I know GLM mat4 are mat4[column numb][row numb][/QUOTE] With GLM it's: Translation * Rotation * Scale With DirectX: Scale * Rotation * Translation In the shader, on DirectX: output.Position = mul(float4(input.Position, 1), gWorldMatrix); output.Position = mul(output.Position, gProjViewMatrix); It may be a different order on OpenGL (multiply by ProjView first, then World)
[QUOTE=Lord Ned;36184761]With GLM it's: Translation * Rotation * Scale With DirectX: Scale * Rotation * Translation In the shader, on DirectX: output.Position = mul(float4(input.Position, 1), gWorldMatrix); output.Position = mul(output.Position, gProjViewMatrix); It may be a different order on OpenGL (multiply by ProjView first, then World)[/QUOTE] Yea glsl is: gl_Position = MVP * vec4(Position, 1.0f); [editline]3rd June 2012[/editline] Thanks for clearing up the Model matrix stuff :)
[QUOTE=Naelstrom;36178926]I guess someone is not feeling adventurous today. :([/QUOTE] You clearly have not used Git for Windows
Trying to create a method that returns an array but its just not being as easy as I want it too. I tired googling this problem but none seem to fit my situation. [cpp] Entity * GameObjectManager::getInt(Entity::entityName name) { std::map<int, Entity*>::const_iterator results = _gameObjects.begin(); static Entity * r[10]; int index = 0; if(results->second->name == name) { r[index] = results->second; index++; } return r; } [/cpp]
Return a vector.
[QUOTE=esalaka;36186947]Return a vector.[/QUOTE] This has to be a super hacky way of doing this but I cannot think of any other way to do this. [cpp] std::map<int, Entity*> GameObjectManager::getGroup(Entity::entityName name) { std::map<int, Entity*>::const_iterator itr = _gameObjects.begin(); std::map<int, Entity*> temp; while(itr != _gameObjects.end()) { if(itr->second->name == name) { temp.insert(std::pair<int,Entity*>(itr->second->getID(),itr->second)); } itr++; } return temp; std::for_each(temp.begin(),temp.end(),GameObjectDeallocator()); } [/cpp] [cpp] std::map<int, Entity*> tempArray = Main::GetGameObjectManager().getGroup(Entity::entityName::entityBullet); std::map<int, Entity*>::const_iterator itr = tempArray.begin(); while(itr != tempArray.end()) { if(itr->second->GetBoundingRect().intersects(GetBoundingRect())) { SetPosition(0,0); Main::GetGameObjectManager().Remove(itr->second->getID()); } itr++; } [/cpp]
[QUOTE=Jimmylaw;36187139]This has to be a super hacky way of doing this but I cannot think of any other way to do this. [cpp] std::map<int, Entity*> GameObjectManager::getGroup(Entity::entityName name) { std::map<int, Entity*>::const_iterator itr = _gameObjects.begin(); std::map<int, Entity*> temp; while(itr != _gameObjects.end()) { if(itr->second->name == name) { temp.insert(std::pair<int,Entity*>(itr->second->getID(),itr->second)); } itr++; } return temp; std::for_each(temp.begin(),temp.end(),GameObjectDeallocator()); } [/cpp] [cpp] std::map<int, Entity*> tempArray = Main::GetGameObjectManager().getGroup(Entity::entityName::entityBullet); std::map<int, Entity*>::const_iterator itr = tempArray.begin(); while(itr != tempArray.end()) { if(itr->second->GetBoundingRect().intersects(GetBoundingRect())) { SetPosition(0,0); Main::GetGameObjectManager().Remove(itr->second->getID()); } itr++; } [/cpp][/QUOTE] Give it a reference instead to avoid copying the std::map. [cpp] void GameObjectManager::getGroup(Entity::entityName name, std::map<int, Entity*> &list) { list.clear(); std::map<int, Entity*>::const_iterator itr = _gameObjects.begin(); while(itr != _gameObjects.end()) { if(itr->second->name == name) { list.insert(std::pair<int,Entity*>(itr->second->getID(),itr->second)); } itr++; } std::for_each(list.begin(),list.end(),GameObjectDeallocator()); } [/cpp] [cpp] std::map<int, Entity*> tempArray; Main::GetGameObjectManager().getGroup(Entity::entityName::entityBullet, tempArray); std::map<int, Entity*>::const_iterator itr = tempArray.begin(); while(itr != tempArray.end()) { if(itr->second->GetBoundingRect().intersects(GetBoundingRect())) { SetPosition(0,0); Main::GetGameObjectManager().Remove(itr->second->getID()); } itr++; } [/cpp]
[QUOTE=Z_guy;36187491]Give it a reference instead to avoid copying the std::map. [/QUOTE] Either I'm being slow or I just don't understand this but how does the updated "tempArray" get passed back from getGroup method to the function that wants it? Or it is because your passing it a pointer and not an object?
[QUOTE=Jimmylaw;36187673]Either I'm being slow or I just don't understand this but how does the updated "tempArray" get passed back from getGroup method to the function that wants it? Or it is because your passing it a pointer and not an object?[/QUOTE] [cpp]std::map<int, Entity*> &list[/cpp] Notice the &-sign? That means you're passing in a reference, which works kind of like a pointer. It means you're passing in the actual object instead of a copy of it.
So i am mucking around with the Farseer Physics Engine. I'm running into issues loading content with Debug View. [code]DebugView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.Content);[/code] When this code is run, i get "Error loading "font". File not found." How should i fix this? I assume that ScreenManager.Content is empty or something and it's attempting to load a font that doesn't exist or something.
This sort of thing is a bit beyond my understand right now, but basically I am doing some bit twiddling. However, I am not sure if my pack function is correct, it seems to work properly but I am just not sure and would like insight from a more experienced programmer. [url]http://pastebin.com/v1dsdWnH[/url] Also, I am aware that the function names are poop.
It looks fine to me.
I've been programming for quite some time now (five courses in 2.5 years, one introductory course taught in C++ which I finished during my first year, in a week. I had two C++ and two Java courses during my second and third year), with excellent grades. I know much of learning to program is to just practice and experiment by yourself, and that I have done, but I feel like I'm not advancing any more in C++. I have a good grasp of classes and pointers in C++ and I've been doing some 2d work in SDL and SFML. I've started nosing about with templates in C++ but I haven't found anything interesting to use them with, yet (finding them quite hard to understand right now, actually) Suggestions? and what should I try to focus on doing after that?
so I'm trying to find a method to optimize drawing with rectangles, using the least amount of rects possible. I got it to check horizontally: [img]http://puu.sh/ySLm[/img] but no matter how hard I try, I can't get it to check vertically as well. The code is really ugly, but the logical steps behind how I did it are like this: [code] at pixel (x, y) check horizontally if the colors are the same repeat at (x + 1, y) else check downwards for the whole rectangle if all the colors are the same repeat at (x, y + 1) else back up, store the rectangle end end end [/code] I don't even know if the rectangles are just getting overlapped, because LOVE sucks with debugging is there a better way to do this? or an example I can look at?
I've been stuck with this for a while, I'm hoping that WDYNHW will be my savior. I've been trying to make a 2D platformer forever, one similar to SMB or Megaman. I know how to draw everything and get moving, but how would I make it so if it collided with a certain area (such as a wall) it would stop jumping, stop moving, or whatever. I can't figure this one out.
How do big devs handle things like entity systems? I know they are usually component based and before I start writing code I want to plan this out, lest I get awful and incomprehensible code that I just don't want to deal with. Like what does gamebryo do?
Sorry, you need to Log In to post a reply to this thread.