Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 06:01:30 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General thread for quick questions
Pages: 1 ... 49 50 [51] 52 53 ... 69
Print
Author Topic: General thread for quick questions  (Read 135339 times)
oahda
Level 10
*****



View Profile
« Reply #1000 on: February 27, 2017, 08:44:39 AM »

Hehe, yeah, I know, but I've learned what to ignore and what to look at when I get template errors, and generally know what one line to fix (and how) to get rid of those 50 errors (been doing it without an IDE this weekend!)~
Logged

JWki
Level 4
****


View Profile
« Reply #1001 on: February 27, 2017, 08:50:46 AM »

Hehe, yeah, I know, but I've learned what to ignore and what to look at when I get template errors, and generally know what one line to fix (and how) to get rid of those 50 errors (been doing it without an IDE this weekend!)~

Yeah usually I just scroll through the compiler output until I find the line that's actually my use code and fix that.
With metaprogramming the output tends to get... weird though. Often times the problem isn't finding the offending lines but rather understanding why the fuck they're offensive to the compiler.
Logged
oahda
Level 10
*****



View Profile
« Reply #1002 on: February 27, 2017, 08:57:42 AM »

On a completely unrelated note BTW: thanks again for suggesting premake! While I didn't have an IDE this weekend (command line only), I did have a premake file to generate a makefile from all the C++ files in a particular folder and a bash script to invoke that, then make, then the product, which made it almost as nice to work with!
Logged

JWki
Level 4
****


View Profile
« Reply #1003 on: February 27, 2017, 10:08:38 AM »

Happy my suggestion is useful!
Logged
RLofC
Level 0
***



View Profile WWW
« Reply #1004 on: February 27, 2017, 02:10:04 PM »

On not using an IDE and getting rid of errors, ViM together with YCM is a real life-saver.
Logged

oahda
Level 10
*****



View Profile
« Reply #1005 on: February 27, 2017, 10:42:50 PM »

I'm not quite hardcore enough for vi(m) or emacs, but I did get to know nano better than ever before during this weekend and got a lot more efficient with it!

Got the checking for methods working, BTW. The end result looks kind of like a mix between the snippet I showed and JWKi's example, and I learned just why the ellipsis is necessary and why I get an ambiguity without it. Yay for learning!
Logged

JWki
Level 4
****


View Profile
« Reply #1006 on: February 28, 2017, 12:07:55 AM »

I have to use ViM occasionally and the thing I'm most happy about is that I am now somewhat able to deal with my git bash having me explain why a merge was necessary without having to kill the process because I can't get out of the god damn text editor.
Logged
RLofC
Level 0
***



View Profile WWW
« Reply #1007 on: February 28, 2017, 01:30:49 PM »

BTW Prinsessa, I think I'm trying to achieve a similar goal wrt to using concrete objects directly. In my case, I'm using SFINAE to swap the base types of potential containers types so they won't use members from their content. For example, I have a container type that can potentially hold a "drawable" type.

If it does, it will expose its content type using a standard typename:
https://github.com/rlofc/GameDevTemplates/blob/master/src/core/traits.hh#L152

If it doesn't, the default type will be used (through SFINAE) to avoid compilation errors:
https://github.com/rlofc/GameDevTemplates/blob/master/src/core/traits.hh#L143

The end result is being able to provide the user with the actual contained object, using its actual type, even when called from within internal engine code, for example:
https://github.com/rlofc/GameDevTemplates/blob/master/src/core/shaders.hh#L885

So, regardless to how deep is the object in its container chain, the returned object will always be of the user's concrete type.
« Last Edit: February 28, 2017, 02:52:09 PM by RLofC » Logged

oahda
Level 10
*****



View Profile
« Reply #1008 on: March 01, 2017, 11:54:20 AM »

Interesting! Here's what I was messing with during the weekend:
https://bitbucket.org/avaskoog/ecstestblocks/src
Logged

Zorg
Level 9
****



View Profile
« Reply #1009 on: March 01, 2017, 02:55:38 PM »

Is there a standard method in Unity to get the vertices of a polyhedron which is the result of an intersection between a 3d object (polygon potato) and a plane?

What's the correct mathematical term i'm searching for? Shrug



P.S.: I don't want to actually slice the 3D object, i'm  only interested in the blue points.
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1010 on: March 01, 2017, 05:03:40 PM »

For what I know you will have to compute tri-plane intersection and find it yourself

Basically you will need to:

- check if all point of a triangle is on one side of the triangle (dot product, if they all have the sign they are on the same side and don't intersect)

- if one point is of a different sign, all edges that lead to him are intersected, so now you need to compute line/plane intersection to find the actual point. Which I don't know as of typing right now. -> googling give me that: http://geomalgorithms.com/a06-_intersect-2.html#Triangle-Plane

edit: I think you can use vector projection on the normal of the plane, haven't read this link yet.
Logged

Zorg
Level 9
****



View Profile
« Reply #1011 on: March 01, 2017, 11:58:04 PM »

Sounds good, thanks! Smiley

Follow-up question: How to i get all the resulting points in the right order (clockwise or counter-clockwise) if the polyhedron happens to be concave? (Let's pretend the result would always be exactly one polyhedron without holes for simplicity's sake.)

Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1012 on: March 02, 2017, 01:47:58 AM »

Connect them based on the origin triangle intersection. Otherwise there are multiple valid solutions, there's no way to tell which one is the "correct" solution.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
oahda
Level 10
*****



View Profile
« Reply #1013 on: March 02, 2017, 03:23:54 AM »

Where can I get that 3D scene that people always use to show of their engines? The one inside a stone building with lots of big cloths in bright colours hanging down.
Logged

Polly
Level 6
*



View Profile
« Reply #1014 on: March 02, 2017, 03:54:19 AM »

Where can I get that 3D scene that people always use to show of their engines? The one inside a stone building with lots of big cloths in bright colours hanging down.

Google "Sponza Atrium" Wink
Logged
oahda
Level 10
*****



View Profile
« Reply #1015 on: March 02, 2017, 04:53:39 AM »

Where can I get that 3D scene that people always use to show of their engines? The one inside a stone building with lots of big cloths in bright colours hanging down.

Google "Sponza Atrium" Wink
That's the one! Thanks! What's the story behind it anyway?
Logged

JWki
Level 4
****


View Profile
« Reply #1016 on: March 02, 2017, 04:59:30 AM »

Where can I get that 3D scene that people always use to show of their engines? The one inside a stone building with lots of big cloths in bright colours hanging down.

Google "Sponza Atrium" Wink
That's the one! Thanks! What's the story behind it anyway?

It was initially created for some CryTek tech demo I believe.
Logged
oahda
Level 10
*****



View Profile
« Reply #1017 on: March 03, 2017, 06:40:54 AM »

On iOS, the .app folders have special document and temp folders that I'm allowed to write to and modify without breaking code signing or whatever. Is this also true on OS X, or do I have to do that stuff in external places like /tmp and /Library/Application Support?

EDIT:
Seems like the latter is true (no such folders but use the ones I mentioned), yes.
« Last Edit: March 03, 2017, 06:55:30 AM by Prinsessa » Logged

oahda
Level 10
*****



View Profile
« Reply #1018 on: March 04, 2017, 03:59:35 AM »

Having a weird issue with git, and all results I can find on Google only seem to apply if this is a general problem, but I'm only experiencing this with a single repository that I just created—all the rest still work fine.

On a Mac, and just copied a folder with a git repo (yeah, yeah, I could use branching, but it's just a quick test project), removed .git from the copy, called git init again, then the usual git remote add … to connect it to the repo on BitBucket. Add the files and commit. But when I try to push, it says:

Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts.
no such identity: ~/.ssh/bitbucket: No such file or directory
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


And all the search results would make sense if this was a general problem, but like I said it's only this one repository (I tried adding some test files to another repo and pushed and had no issues), so I don't get it...

I did use a git thing on my tablet just the other day, and I see it added an SSH key to my BitBucket account, so I assume that has something to do with it. I seem to have no other keys, tho, so I don't know how it worked before, and it still doesn't explain while all my other repos still work and can push... Tried adding a new key, but I'm getting complaints about ~/.ssh/bitbucket or ~/.ssh/identity missing... q_q

EDIT:
Removed the SSH key added by the app and it works again. But that's not really a solution if I want to be able to use both the app and computer to manage repos. But I guess this means that I never did have an SSH key setup for BB on any of my computers, so I need to do that properly from scratch and presumably those missing files are added somewhere along the correct process. Leaving this here in case anybody else ever bumps into this obscure problem, I guess... Tongue
« Last Edit: March 04, 2017, 04:12:47 AM by Prinsessa » Logged

Oats
Level 1
*


High starch content.


View Profile
« Reply #1019 on: March 08, 2017, 09:23:28 PM »

Hi all, I was wondering about how to efficiently save chunks of map data. My map is mainly composed of 8x8x8m smooth voxel terrain, where the data for each chunk is stored as a 32bit-float[8][8][8]. The data is procedurally generated, and the player can modify to their hearts content, so without compression each chunk contains 8*8*8*4bytes=2kB of data. Right now I have the program multithreaded such that the main thread handles openGL, physics and game logic, which'll periodically send requests for changes in terrain to a voxel managing thread. The voxel thread loads chunks if they exist on file, generates them if they don't, skins the voxels, then sends a packet with the finished triangles back to the main thread. I'm saving data by just writing the 2kb to a file identified by the coords of the chunk, this seems quite performant, but occasionally creates visible lag between the player digging terrain and the effects appearing (because the voxel thread can get stuffed with load requests, which due the order required for skinning to work, must be completed before skinning begins). The potential problem is that in about 2 minutes of gameplay you can easily create ~500 2kb files, and I was wandering if it could be sped up in some way, or because of hard drive fragging this might be unethical. Is there a way to package little files into a large file in a way that random access will be performant, even if this large file gets very large?

tldr; saving potentially thousands of 2kB files to disk, is this a problem? And if so is there a way to better it? (While remaining as fast as possible).
Logged

eh
Pages: 1 ... 49 50 [51] 52 53 ... 69
Print
Jump to:  

Theme orange-lt created by panic