• What Do You Need Help With? V6
    7,544 replies, posted
True, for fundamental types moving will do nothing, it will result in a regular copy.
I just installed linux(ubuntu14) a few hours ago and i'm trying to figure out how I can create a symbolic link to my python script. The script is a basic script to hash a string from command-line arguments. Ex. hash.py md5 hello How can I call the script from terminal by simply typing (hash md5 hello)? I've tried creating a shell like this [CODE] #hash.sh python /home/user/Desktop/python/hash.py $var1 $var2 [/CODE] and creating a symlink to the .sh file but all it becomes is a 'link to text' filetype, instead of an application shortcut. Both hash.py and hash.sh have executable permission My python script uses [CODE]sys.argv[1], sys.argv[2][/CODE] Sorry if it's in the wrong thread/subforum So apparently using a shell script is redundant. All that was needed was to create a symlink to the python script :v:
I have a really hard time with data architecture or whatever, like knowing how data should be organized or how a class should be built and I'm wondering if there's something I can read to help me out? I've been struggling with it for a while.
I've been using rastertek for a while for directx/opengl tutorials, but their tutorials have mysteriously disappeared for no reason off their site. Is there possibly a mirror of this site or is it gone forever? Sorry if this is the wrong thread, but I couldn't really figure out an appropriate place to ask.
I am receiving an error upon my server. [quote]./vpk.sh: line 3: 21636 Illegal instruction (core dumped) vpk_linux32 "$@"[/quote] This was working perfectly ~10 hours ago and I made no changes during the advent of the issue. If anyone versed in this sort of thing could help, I would [I]really[/I] appreciate it. [editline]30th July 2014[/editline] I copied the file from my server to my computer and the issue is not present when using it here. There must be something on the server causing the issue. [editline]30th July 2014[/editline] I looked about for the core dump, but couldn't find it. I'll try again now.
[QUOTE=Sombrero;45546500]I've been using rastertek for a while for directx/opengl tutorials, but their tutorials have mysteriously disappeared for no reason off their site. Is there possibly a mirror of this site or is it gone forever? Sorry if this is the wrong thread, but I couldn't really figure out an appropriate place to ask.[/QUOTE] Will this work? [url]http://web.archive.org/web/20140625070410/http://rastertek.com/tutindex.html[/url]
How do most people scale there 3D world? Do they base there units off of real world measurements? Or just arbitrary "units"? Specifically, I don't know jack about 3D to much, and I can draw a 3d cube on the screen [code] glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top) glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top) glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top) glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top) // other sides vertices here, etc [/code] But what is the "size" of said cube? 1x1x1 vertex? If I want a box that's 1x1 meters and then another that's 6x6 meters, how would I draw the object? Just multiple each vertex by a value/scale? Thanks, i'm dumb and have a lot of questions.
[QUOTE=Drak_Thing;45554327]How do most people scale there 3D world? Do they base there units off of real world measurements? Or just arbitrary "units"? Specifically, I don't know jack about 3D to much, and I can draw a 3d cube on the screen [code] glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top) glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top) glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top) glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top) // other sides vertices here, etc [/code] But what is the "size" of said cube? 1x1x1 vertex? If I want a box that's 1x1 meters and then another that's 6x6 meters, how would I draw the object? Just multiple each vertex by a value/scale? Thanks, i'm dumb and have a lot of questions.[/QUOTE] The size of this cube is one. You're technically dealing with dimensionless qualities. You get to decide what unit to use for what length. One metre for 1.0 might work, or it might not - kinda depends on what you're doing. [editline]31st July 2014[/editline] No, wait, it's the unit cube? It's more than 1 [editline]31st July 2014[/editline] But basically yeah - if you want a box of 6x6 metres then its sides are 6 times as much as 1 metre? [editline]31st July 2014[/editline] Goddamn, it's [B]not[/B] the unit cube is what I meant.
[QUOTE=Drak_Thing;45554327]How do most people scale there 3D world? Do they base there units off of real world measurements? Or just arbitrary "units"? Specifically, I don't know jack about 3D to much, and I can draw a 3d cube on the screen [code] glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top) glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top) glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top) glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top) // other sides vertices here, etc [/code] But what is the "size" of said cube? 1x1x1 vertex? If I want a box that's 1x1 meters and then another that's 6x6 meters, how would I draw the object? Just multiple each vertex by a value/scale? Thanks, i'm dumb and have a lot of questions.[/QUOTE] Usually you'd use the same vertex data and scale using your model matrix.
[QUOTE=Drak_Thing;45554327]How do most people scale there 3D world? Do they base there units off of real world measurements? Or just arbitrary "units"? Specifically, I don't know jack about 3D to much, and I can draw a 3d cube on the screen [code] glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top) glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top) glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top) glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top) // other sides vertices here, etc [/code] But what is the "size" of said cube? 1x1x1 vertex? If I want a box that's 1x1 meters and then another that's 6x6 meters, how would I draw the object? Just multiple each vertex by a value/scale? Thanks, i'm dumb and have a lot of questions.[/QUOTE] Asking questions is not dumb. in addition to esalaka's reply i'd like to add: The scale is whatever you choose. Pick something simple for your math and appropriate for your content, I like to use 1 unit in game = 1 inch on the model, when dealing with things under a mile (63360 inches). However if i am dealing with larger objects like making a space game with a solar system the numbers are astronomical, so in that case I would probably go with, 1 unit in game = 1 mile, then the earth would be a sphere with a diameter of 7926 units, because Earth's equatorial diameter is 7,926 miles and if 1 unit was 1 inch it's be 502191360 units in diameter. Conversely if you were dealing with something super small you could say 1 unit in game = 1 nanometer and represent a molecular model. so the size of your cube is: @ 1 unit = 1 inch -- 2" x 2" x 2" @ 1 unit = 1 foot -- 2' x 2' x 2' @ 1 unit = 1 meter -- 2m x 2m x 2m @ 1 unit = 1 lightyear -- 2ly x 2ly x 2ly [B]also: [/B] a cube that's 1x1x1 would be 0.5 and -0.5 respectively instead of the 1's that you have
What programming communities do you guys frequent, if any? I'm looking for something similar to polycount/cgtalk for 3D modeling, if that even exists. Not too fond of Reddit, although I do browse r/programing/gamedev/learnprogramming every now and then. There's just something about the "traditional" forum atmosphere that I enjoy more. For instance, I love browsing the Facepunch programming section, but aside from WAYWO (which is amazing, albeit a bit slow-moving) it's not all that active. I'm not very good at programming yet, but I love reading blogs and other stuff about it all.
Has anyone here worked with level generation using BSP Trees? I'm working on my final year project for uni, a dungeon crawler using BSP Trees for the level generation. I've got the rooms generating, but I have no idea how to add corridors between them, and all the tutorials I've found on the internet don't make sense to me. Does anyone here have any idea how to do that? I've put the whole project up here: [url]https://github.com/stnick5/DungeonCrawler[/url] All the level generation code is in bspGenerator.cpp and bspNode.cpp. I've been trying to get my head around this for weeks and gotten nowhere. edit - The program also seems to crash when trying to draw the player sprite. Only occasionally though, which makes it more difficult to find out why it's doing it.
this any help? [url]http://gamedevelopment.tutsplus.com/tutorials/how-to-use-bsp-trees-to-generate-game-maps--gamedev-12268[/url] [url]http://www.roguebasin.com/index.php?title=Basic_BSP_Dungeon_generation[/url] My question: I'm making a log/console/debug tool. I want Assembly A to register some methods to the logging application, so when they enter a command into the console (in the logging application), they execute the method of Assembly A In other words Assembly A registers some methods ,let's call them Method1 and Method2, along with some commands CallMethod1 and CallMethod2 A B C (paramters :p) In the console on the logging app you enter "CallMethod1", and then Method1 is being called. How would i go about this? I tried some stuff, but can't get it modular enough and don't know how to do parameters. This is what i have now (with some code ommited that is of no importance (like the dictionary initializer) [code] private static Dictionary<string, Assembly> Assemblies; public static void RegisterAssembly(string assemblypath, string assemblyname) { var assembly = Assembly.LoadFrom(assemblypath); Assemblies.Add(assemblyname, assembly); } public static void RunMethod(string assembly, string methodClass, string methodname) { var targetAssembly = Assemblies[assembly]; Type type = targetAssembly.GetTypes().FirstOrDefault(_type => _type.Name == methodClass); if(type == null) { return; } MethodInfo method = type.GetMethod(methodname); object instance = Activator.CreateInstance(type); method.Invoke(instance, null); } [/code] This is just still testcode btw.
[QUOTE=Arxae;45561798]this any help? [url]http://gamedevelopment.tutsplus.com/tutorials/how-to-use-bsp-trees-to-generate-game-maps--gamedev-12268[/url] [url]http://www.roguebasin.com/index.php?title=Basic_BSP_Dungeon_generation[/url] [/QUOTE] I actually have those two bookmarked, I just can't get my head around it. Think the problem is they give a basic description of what needs to be done, then gives you a shitload of code without explaining in detail what it's doing.
That's code tutorials for you :f How about these? [url]http://eskerda.com/bsp-dungeon-generation/[/url] [url]http://www.saschawillems.de/?page_id=395[/url] Second one is another explanation, but it seems like it explains it a bit more in depth
I managed to get some of the rooms connected up. Not all of them though. [url]http://i131.photobucket.com/albums/p313/st_nick5/Portfolio/basicCorridors_zps139c0220.png[/url] This is the code. Basically going down and finding all the leaf nodes, and constructing a corridor between them. I'm not sure what I need to do now to connect all the others up. I'm also not sure how in the picture there are three rooms connected up to each other. [code] void bspNode::findLeafNodes(bspNode* parentNode) { if (left != NULL) { left->findLeafNodes(this); right->findLeafNodes(this); } else { parentNode->buildCorridor(); } } void bspNode::buildCorridor() { if (left->getHorizontal()) { newCorridor.posMin.x = left->getCenter().x; newCorridor.posMax.x = right->getCenter().x; newCorridor.posMin.y = left->getCenter().y-2; newCorridor.posMax.y = left->getCenter().y+2; } else { newCorridor.posMin.x = left->getCenter().x-2; newCorridor.posMax.x = left->getCenter().x+2; newCorridor.posMin.y = left->getCenter().y; newCorridor.posMax.y = right->getCenter().y; } hasCorridor = true; } [/code]
So I'm trying to implement some sort of KD-tree (like a BSP tree). The idea is, I start with a list of 2d coordinates, find the mean of one of the coordinates, then split them into two lists (one with a greater value than mean, one with less). It's then recursive until all the lists have only 1 set of coordinates in them. This works (I think..), but now I'm trying to traverse the list from the top and I can't get that working. Here's the basic code: EDIT: Nevermind, got it! :smile:
[QUOTE=Bael;45559968]What programming communities do you guys frequent, if any? I'm looking for something similar to polycount/cgtalk for 3D modeling, if that even exists. Not too fond of Reddit, although I do browse r/programing/gamedev/learnprogramming every now and then. There's just something about the "traditional" forum atmosphere that I enjoy more. For instance, I love browsing the Facepunch programming section, but aside from WAYWO (which is amazing, albeit a bit slow-moving) it's not all that active. I'm not very good at programming yet, but I love reading blogs and other stuff about it all.[/QUOTE] We have a modeling forum :v:
-snip- Nevermind that, my typedef was breaking everything seeing as I had it after a function, my previous code was kinda correct and I messed it up. [t]http://i.imgur.com/J4ncswV.png[/t] Edit: Although I am having another issue. [t]http://i.imgur.com/sUdSgsL.png[/t] [CODE]#include <iostream> using namespace std; typedef unsigned short int ushort; typedef unsigned long int ulong; unsigned short int Perimeter(ushort result); int main() { int result; ushort number1, number2; cout << "Number 1: "; cin >> number1; cout << "Number 2: "; cin >> number2; Perimeter(result); cout << result; } unsigned short int Perimeter(ushort result) { return 2*result; }[/CODE] [QUOTE]Write the prototype for a function named Perimeter(), which returns an unsigned long int and takes two parameters, both unsigned short ints. [/QUOTE]
You are never writing anything to result. Your Perimeter() takes one unsigned short and returns one unsigned short. As in your quote, it should take [I]two [/I]unsigned shorts and return one unsigned [I]long[/I].
[QUOTE=Map in a box;45569015]We have a modeling forum :v:[/QUOTE] Worded that terribly, sorry. I was basically asking if there are any programming forums that are laid out like Polycount/CGtalk.
How do I check/know/find out what kind of .NET Framework version a PC needs for it to be able to run my C# applications? Do I have to compile the source with an older .NET Framework version for this or is there a more convenient way to do this? I am using Visual Studio Express 2013.
[QUOTE=marvinelo;45574690]How do I check/know/find out what kind of .NET Framework version a PC needs for it to be able to run my C# applications? Do I have to compile the source with an older .NET Framework version for this or is there a more convenient way to do this? I am using Visual Studio Express 2013.[/QUOTE] It's probably 4.5 by default, but you can check it (and change it) by right clicking the project in the Solution Explorer and selecting properties. On there you can see the target framework version.
I think I found a bug in VS2013 again, and I got question. First, with C++11 you can initialize const members of classes inside the header. However, it seems that in VS2013, even the November CTP, changing the values of these variables does not cause a recompiliation/linking, so the values are stored unless you make another change to the header resulting in this. This is pretty shitty since it seems like you can't create arrays with const variables, but ones that must be static too. Which leads me to my question. Why can't you initialize arrays with simple const members?
[QUOTE=RaTcHeT302;45572834]-snip- Edit: Although I am having another issue. [t]http://i.imgur.com/sUdSgsL.png[/t][/QUOTE] In addition to what DrTaxi said, the reason for the error is that in main you are passing result as an argument to Perimeter without initializing it. It looks like what you want to do is pass both number1 and number2 to the function, and assign the return value to result. Result should also be an unsigned long. Also, you can omit the 'int' in 'unsigned short int'. 'unsigned short' means the same thing.
[code] do { newGems.x = randGemPosX(randomGen.generator); newGems.y = randGemPosY(randomGen.generator); } while ((tileMap[newGems.x][newGems.y] != 1) && (itemMap[newGems.x][newGems.y] != 0)); [/code] This code is acting very strange. If tileMap[][] == 1, and itemMap[][] == 0, it should break out of the code. If one of those isn't true, for instance if tileMap[][] == 1 and itemMap[][] == 8, it should loop back and run the code again, however when it hits those values it breaks out. Does anyone know why this is happening? edit - Fixed it. Changed it to an || rather than an &&. Took a while to get my head around that one.
[QUOTE=st_nick5;45579905][code] do { newGems.x = randGemPosX(randomGen.generator); newGems.y = randGemPosY(randomGen.generator); } while ((tileMap[newGems.x][newGems.y] != 1) && (itemMap[newGems.x][newGems.y] != 0)); [/code] This code is acting very strange. If tileMap[][] == 1, and itemMap[][] == 0, it should break out of the code. If one of those isn't true, for instance if tileMap[][] == 1 and itemMap[][] == 8, it should loop back and run the code again, however when it hits those values it breaks out. Does anyone know why this is happening? edit - Fixed it. Changed it to an || rather than an &&. Took a while to get my head around that one.[/QUOTE] This is [url=https://en.wikipedia.org/wiki/De_Morgan%27s_laws]De Morgan's law[/url]. [img]https://upload.wikimedia.org/math/9/4/d/94d249382b22901ebeb47b72224223c9.png[/img] (the dot is the 'AND' operator)
Is it at all possible to write software for realtime motion tracking from like a webcam in python? If so where on EARTH would you start?
[QUOTE=Garry #2;45601529]If so where on EARTH would you start?[/QUOTE] Google, then most likely either a blog or github. Or in this case, both: [url]http://derek.simkowiak.net/motion-tracking-with-python/[/url]
So I started trying to learn OpenGL (Specifically GLES) and is it pretty normal to be really confused about it all? I've been reading more tutorials on it and some of it is starting to make sense, but the shaders aren't quite clear yet. Does anyone have any advice towards clearing this stuff up?
Sorry, you need to Log In to post a reply to this thread.