« first day (2869 days earlier)      last day (2447 days later) » 
00:00 - 16:0016:00 - 00:00

00:00
I worked at a place where the boss wanted to have the binaries committed, so he could checkout the project and show it to someone or whatnot.
I'm not sure it is the best approach.
I am still unsure how you would turn a Unity project into an actual application.
I know it has options for different platforms, but releasing I have no idea
0
Q: What's our stance on self answered questions that don't show any research effort?

Alexandre VaillancourtI've seen a couple Questions go by in the past where the user asked the question, then answered it immediately. Often, these questions were simple, a little bit more elaborated than this example: How can I smurf? The posted Answer was effectively answering the question. However, there is...

@TheMattbat999 I hope you find out when you get there :)
@AlexandreVaillancourt yeah I got a while anyway...
@AlexandreVaillancourt that's a really bad approach :(
i'd have a continuous integration process that compiles versions off the master branch and pushes them into a different branch automatically
needs like that should not overrule developers' needs to have relatively clean commits
00:22
@doppelgreener Yeah. it was like 10 years ago. Scrum wasn't much trendy yet, and the concept of deliverables was quite vague, at least for that company. For some reasons, that game never got enough traction to be released, and the company closed at some point.
Gamedev is a hard industry.
00:38
wow
did you guys see this
a demo of unity 2018
01:14
@cubesnyc That's beautiful!
01:43
i know!
looks like a movie or something
 
5 hours later…
06:52
1
Q: Weird shader behavior on different devices

therainycatI'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as usual, and if more than 1.0 then SDF is used (using GL_REPEAT uv.x and uv.x + 1.0 look similar) Frag...

 
6 hours later…
12:55
Morning chat!
@AlexandreVaillancourt Good morning(afternoon?)
0
Q: Drawing a sphere in opengl

The Masked RebelI have a problem with my spheres and I need to check them by rendering them on screen. The spheres are defined by center,radius. I am using lwjgl3 with opengl and I need to draw them. How do I render a sphere in opengl and lwjgl3?

user92578
The fastest approach would probably be loading up a sphere model and scaling that
@Tyyppi_77 that would be good... if I was actually trying to load up a sphere. I'm trying to debug a problem with my spheres and I need to render the spheres encircling the objects
user92578
omfg
user92578
i dont know why i even bother trying to help you
13:05
@Tyyppi_77 or maybe Ill try and get the bounding box of a sphere
that should be fine
user92578
or maybe just render a sphere
@Tyyppi_77 I just checked. I can't in lwjgl3
user92578
opengl can render any mesh in a valid format you give it
I'm going to have to load up a model and scale it by the spheres radius
user92578
that would be good if you actually were trying to load up a sphere
user92578
13:11
But you are trying to debug a program with your spheres and you need to render the spheres encircling the objects
user92578
Yes, LWJGL is not GLU so it doesn't provide that since it's not standard OpenGL
2
user92578
Writing a circle tesselator is like 30 lines of code though, and you can load up a model as I said so don't say shit like "I can't in lwjgl3"
@Tyyppi_77 Are you going to create an answer on my post
user92578
no
13:16
@Tyyppi_77 why
user92578
i dont like providing answers to questions that are bad & easily researchable
ill just provide it myself
@Curio hi
user92578
I don't think it's very cool that you use community wiki posts to try to evade any potential downvotes
if you go to the sandbox and type //macky you'll find a very cute easter egg
user92578
@TheMaskedRebel not really an easter egg if you script it yourself
13:27
@Tyyppi_77 I sort of agree but I didn't know what to call it
user92578
a command
alright but it is kinda cute
user92578
not a huge fan of christian propaganda aimed at children myself but whatever floats your boat
Hi
13:44
o/
14:01
@Tyyppi_77 you wanted the code i used to make @nwp solution work. Well, here it is:
private void create(TexturedModel model) {
		Vector3f[] vertices = model.getVertices();
		Vector3f center = vertices[0];
		float radius = 0;
		for(int i = 1; i < vertices.length;i++) {
			float dist = abs(Vector3f.dot(center, vertices[i]));
			radius += dist;

			Vector3f centerIncrease = new Vector3f(dist / 2,dist / 2,dist / 2);

			center = Vector3f.add(center, centerIncrease, null);


		}

		this.center = center;
		this.radius = radius;
	}
user92578
thats not what he described but whatever
well i just tested it out and it didn't work @nwp can you help me with your solution again
user92578
for one, you increase the radius way too much
user92578
and the center movement needs to be weighted
nwp
nwp
You can skip cases where the vertex is already in the circle. Skip in the sense of continue.
14:12
@nwp Like this(the code comes after the calculation of dist):
nwp
nwp
The radius should increase by (distance(vertex, center) - radius) / 2.
And the center should be moved by that same amount in the direction of vertex.
@nwp Do i still need the abs function
nwp
nwp
Do you think you need it?
If yes why, if no why not anymore?
@nwp I think it is jut a precaution. However, if minus increase is alllowed the it will break the code
nwp
nwp
In which case would it be a negative increase?
14:18
@nwp if the distance between vertex, center is negative.
nwp
nwp
What? Distances between 2 points are always positive non-negative.
@nwp is this code correct:
private void create(TexturedModel model) {
		Vector3f[] vertices = model.getVertices();
		Vector3f center = vertices[0];
		float radius = Float.MAX_VALUE;
		for(int i = 1; i < vertices.length;i++) {
			float dist = abs((Vector3f.dot(center, vertices[i])) - radius) / 2;

			radius = dist;

			Vector3f centerIncrease = new Vector3f(dist,dist,dist);

			center = Vector3f.add(center, centerIncrease, null);


		}

		this.center = center;
		this.radius = radius;
	}
nwp
nwp
No.
@nwp What is wrong with it?
nwp
nwp
radius = dist; is definitely not what you want and Vector3f.dot is probably not what you want unless Java is really terrible at naming.
14:22
The way to see if code is correct is to try it, see what it does, if it's wrong, debug it.
@nwp the latter method gets the dot product of two vectors
nwp
nwp
Speaking of Java: Since when does Java have functions like abs? Did they special-case the math library or did they abandon "Everything is an object"?
@TheMaskedRebel That's what I though. I don't know why you are calculating the dot product though.
@nwp the abs function is a static import. If i tried to use another function from the math library it would give me an error
user92578
@nwp oooh interesting point
@Tyyppi_77 @nwp see this, it might help explain:
Static import is a feature introduced in the Java programming language that allows members (fields and methods) defined in a class as public static to be used in Java code; without specifying the class in which the field is defined. This feature was introduced into the language in version 5.0. The feature provides a typesafe mechanism to include constants into code without having to reference the class that originally defined the field. It also helps to deprecate the practice of creating a constant interface (an interface that only defines constants then writing a class implementing that interface...
user92578
14:30
seems very un-java like but that must be a nice feature to have
nwp
nwp
Wikipedia talks about constants, but abs is not a constant. The link at the bottom about Java 8 generalizes it to static members.
Pretty cool actually.
@nwp I'm using java 9
nwp
nwp
@nwp *thought
@nwp the lwjgl vector class is rubbish
nwp
nwp
No distance function?
14:37
@nwp nope, although now that i think of it I can subtract the two vectors from each other and get the length of the resulting vector.
nwp
nwp
Well, got to write your own then. You can even use the static import thing.
user92578
Very rarely is there a dedicated distance function because it's so easy to subtract and do a length on that
nwp
nwp
@TheMaskedRebel And if you do it in the right order you even get the direction of where to move the center.
@nwp Which order do I do it in?
user92578
end - start
14:41
thanks :)
@nwp You said that radius = dist; is not what I wanted. Why?
user92578
that will end up decreasing the size
@Tyyppi_77 so radius += dist; is what i want
user92578
no
@Tyyppi_77 than what
Saw this on LinkedIn. So applicable :D
2
14:48
@PearsonArtPhoto hahahahaha
user92578
I'm not sure if I correctly recall the algorithm that you are implementing so I'm just guessing here: radius = max(radius, distance);, assuming that distance is calculated correctly
thanks @Tyyppi_77 I'll implement the static import ;)
@Jimmy , it has been done.
Hey people
@Tyyppi_77 but do I really want to increase the radius by itself. I think you mean that I check if the distance is greater than radius than set the distance to the radius.
else, continue
user92578
14:55
@TheMaskedRebel that's what the code does
for two locations...
Location 1 and location 2, or A & B
A has X Y and Z,
and a Radius
user92578
But again @TheMaskedRebel, why do you need the smallest bounding sphere?
B also has the same proporties
@Tyyppi_77 He wants to put them on the player to detect colliisions
user92578
yeah but that doesn't require a smallest bounding sphere
user92578
it'll be inaccurate anyways
14:57
@Tyyppi_77 You bet
@Tyyppi_77 I don't. I just need a bounding sphere and I suspected that the code I was using didn't work
@TheMaskedRebel can you find the distance between two points in space?
user92578
@TheMaskedRebel It's trivial to construct a bounding sphere
user92578
Just plop the sphere at the center of the mesh and find the largest distance to a vertex from there
@Tyyppi_77 but non trivial to construct the smallest one
14:58
Or use the library builtin...
user92578
BUT YOU DONT NEED THE SMALLEST ONE
Hey... please keep a civil tone
user92578
dont tell me what to do
@Tyyppi_77 I'd Just tell him what he's doing may not be what he wants, but still show him how to do it.
user92578
Jun 8 at 14:19, by The Masked Rebel
@Tyyppi_77 i suppose a close enough sphere is good enough
user92578
15:00
That'd be a waste of everyones time because we have already covered this topic.
@FreezePhoenix go on
user92578
There also exists a on-site question with an answer to this problem, asked by him.
@TheMaskedRebel If you can find any point on the surface of said sphere C and D that are created from Radius
@Tyyppi_77 wait what
@Tyyppi_77 I'm not asking how to construct it. I have errors in the code I used and I'm asking about them
user92578
15:02
whatever
If you can find any point on the surface of the spheres...
draw a line between their centers.
Next, just see if the distance between 1 of the points and the center of the other sphere is less than Radius
What I think you did wrong was miscalculated the distance.
@FreezePhoenix This is how I'm calculating the distance : float dist = abs((sub(vertices[i],center,null).length()) - radius) / 2;
floating point...
user92578
okay let's make a clarification: what do you want the code to do? generate a sphere or the smallest one?
abs gives you the absolute value...
@TheMaskedRebel what does sub do?
user92578
15:05
subtracts two vectors because java
whats the null for
user92578
destination parameter
java is messed up
user92578
mmhm
ok why are you using .length, what does that do
user92578
15:07
float distance = sub(vertices[i], center), null).length();
user92578
radius = max(radius, distance);
user92578
repeat for all vertices
@FreezePhoenix its the magnitude of the vector
@TheMaskedRebel you need the abs around the sub, but not the radius
@Tyyppi_77 What about the center
@FreezePhoenix Changing....
user92578
15:08
keep it fixed at the mesh's center
user92578
@FreezePhoenix he doesnt need an abs at all
user92578
no he is not
:45132952 I'm constructing a sphere
@TheMaskedRebel and sub can subtract vectors?
That doesn't seem right
@FreezePhoenix lwjgl's naming convention is not the best, I admit it :P
15:12
So can it or can it not?
@FreezePhoenix Yes it can
So lemme reconstruct your code a bit...
for(Number i = 0; i < vertices.length(); i++) {
  float dist = abs((sub(vertices[i],center,null).length()) - radius) / 2;
  //...
Is that right?
user92578
i dont get why we even bother with a more complex solution when just a stupid one will do
@Tyyppi_77 Good point.
15:15
@FreezePhoenix Yup
So... .length finds the length of the array...
user92578
9 mins ago, by Tyyppi_77
float distance = sub(vertices[i], center), null).length();
user92578
9 mins ago, by Tyyppi_77
radius = max(radius, distance);
user92578
8 mins ago, by Tyyppi_77
repeat for all vertices
private void create(TexturedModel model) {
		Vector3f[] vertices = model.getVertices();
		Vector3f center = vertices[0];
		float radius = Float.MAX_VALUE;
		for(int i = 1; i < vertices.length;i++) {
			float dist = (abs(sub(vertices[i],center,null).length()) - radius) / 2;



			radius = max(dist,radius);

			Vector3f centerIncrease = new Vector3f(dist,dist,dist);

			center = add(center, centerIncrease, null);


		}

		this.center = center;
		this.radius = radius;
	}
That is my updated code
15:17
@TheMaskedRebel you have an answer above :P
@Tyyppi_77 no... he wants minimun
radius = min(radius, distance);
user92578
no, he wants the whole mesh to be contained within the sphere
well wtf thats not the smallest
user92578
we are not making the smallest
OH the smallest that contains the entire thing
user92578
we are not making that either
user92578
15:18
we are making a sphere
@FreezePhoenix I think the mistake I made is confusing the dot product with getting the distance
user92578
because it doesn't matter what size it actually is
user92578
because no matter what the sphere is, it will not be accurate
@FreezePhoenix The smallest sphere that contains the whole thing
Isn't getting the smallest bounding sphere hugely expensive?
user92578
15:19
yup
user92578
and unnecessary
@Tyyppi_77 yes, I know... unless the character is roughly sphericle
user92578
@TheMaskedRebel no forget this
user92578
@FreezePhoenix but in that case the simplest solution will be just as accurate!
user92578
because a rough sphericle will have its center roughly at the sphere's center and hence a radius of roughly the sphere
15:21
O(N^2) apparently
I think? Yeah
(actual checks N*(n-1)/2 but yeah)
@FreezePhoenix one question. Will this code generate a sphere that contains the whole mesh(don't worry about size).
IDK java
I'm running on inferences here.
But lemme check
What does add do?
center = add(center, centerIncrease, null);
adds 2 vectors
What's the third argument for
15:24
@KevinvanderVelden a destination parameter
Aah that style
LOL i was about to add that before you asked
user92578
@TheMaskedRebel no
Right, that's legit, might want to use it
So this seems like it'll create a sphere in which the mesh fits
Of course, almost anything will fit in said sphere because it's float.maxvalue radius
And it's somewhere off in who knows where
Hey I have another question. It seems I'm ok at getting images but what I don't seem to be able to get is text from tables. bulbapedia.bulbagarden.net/wiki/… for example how could I just copy the names bulbasaur, ivysaur etc in a list format that works like Bulbasuar \n next pokémon
user92578
15:26
write some sort of data miner / formatter
What tyyppi said
@Tyyppi_77 what is wrong with it
how do I do that?
@TheMaskedRebel the things I just mentioned above
user92578
yeah what kevin said
user92578
15:27
I wouldn't bother fixing that code and just write the few lines of code that create the naive solution
but how?
@PintOfMilk we're gonna need a bit more information like how you're getting access to the image?
yeah I don't mind about the image
user92578
@KevinvanderVelden he explained something about microsoft word yesterday
(also there's 2 conversations going on right now @PintOfMilk so most things weren't directed to you)
15:28
oh ok
@Tyyppi_77 oh huh okay
Are you using something like VBA @PintOfMilk?
user92578
@PintOfMilk copy the table contents to your clipboard and paste them down somewhere, then investigate the format
user92578
maybe clean the beginning and end a little
user92578
and then pick up your favorite scripting language and format the stuff
15:29
</td>
<td class="l"> <a href="/wiki/Bulbasaur_(Pok%C3%A9mon)" title="Bulbasaur (Pokémon)">Bulbasaur</a>
</td>
<td style="background:#FF5959"> 45
</td>
<td style="background:#F5AC78"> 49
</td>
<td style="background:#FAE078"> 49
</td>
<td style="background:#9DB7F5"> 65
</td>
<td style="background:#A7DB8D"> 65
</td>
<td style="background:#FA92B2"> 45
</td>
user92578
alternatively, investigate the HTML and write a javascript that exports that stuff
don't know JS
@PintOfMilk use a wescraper such as..
Oh... wat was the name of the python library...
BeautifulSoup
Ah... yes.
15:30
That's my go-to at least for such things
There's probably others
@Tyyppi_77 no I really wanna fix the code
user92578
@TheMaskedRebel go ahead
@TheMaskedRebel SCRAP THE CODE
Debug the code
It clearly doesn't work.
15:31
learning to use a debugger properly is one of the biggest improvements you can make to your programming skills
Delete it, and come back to it a week later and try again.
Scrapping code...
Took me a while to take to them
this was in the late 90s with Codewarrior on Mac OS System 7.
@Almo yes... but he doesn't know what would be the right values for anything, so it's useless to him.
sys 7 looks like that
16 MB RAM, man
:D
mine had a lot more though since I did my master's physics research on it
might have been 128 MB
don't quite remember
15:33
I wish I could see my ram...
It's probably something like 32 mb
user92578
@FreezePhoenix I really need the code working for more reasons than the petty ones I've said here
user92578
var elements = document.getElementsByClassName("l");
@Tyyppi_77 thanks how do you the attack defense speciall attack special defence speed?
user92578
for (var i = 0; i < elements.length; i += 1) { console.log(elements[i].textContent); }
15:34
do i just paste that in the javascript google chrome window?
@PintOfMilk go. learn. javascript.
user92578
chain nextSibling after elements[i]
@PintOfMilk what languages do you know?
@Jimmy hey
python
that not very well
bit of french
@Tyyppi_77 can you redirect me to the code snippet that trusted the center. I think I posted that about 5 days ago and I can't find it
15:36
Then study this to pieces:
# Wormy (a Nibbles clone)
# By Al Sweigart [email protected]
# inventwithpython.com/pygame
# Released under a "Simplified BSD" license

#KRT 14/06/2012 modified Start Screen and Game Over screen to cope with mouse events
#KRT 14/06/2012 Added a non-busy wait to Game Over screen to reduce processor loading from near 100%
import random, pygame, sys
from pygame.locals import *
SCORE = 0
FPS = 15
WINDOWWIDTH = 640
WINDOWHEIGHT = 480
CELLSIZE = 20
assert WINDOWWIDTH % CELLSIZE == 0, "Window width must be a multiple of cell size."
user92578
@TheMaskedRebel no, go find it out
@PintOfMilk tell me what each line does.
user92578
for (var i = 0; i < elements.length; i += 1) { console.log(elements[i].nextElementSibling.textContent); }
finding it out...
@FreezePhoenix I said not very well
user92578
15:37
Why would you ask him to do that? Seems incredibly unreasonable
@PintOfMilk I know. You don't need to know it well. Just enough to figure out what it does.
just use jquery :)
@Tyyppi_77 sure.... the first 10 lines.
$(".l").text()
7 first lines just comments
15:38
So?
You have a keyboard with a delete key.
user92578
@PintOfMilk So that should give you the HP, then you need to copy that from the console into a text editor and delete the additional lines and then format properly
it imports modules pygame for the making of games and random so that one can have random numbers and system which I'm assumming is like the Os.clear() function
user92578
@Jimmy Great idea.
@PintOfMilk Good job.
Except system is not Os.clear.
like OS.clear()?
Lesson 1) Don't be afraid to use google or a documentation
user92578
why are we sharing python snippets when the dude wants to mine some data from a website?
@Tyyppi_77 because I'm trying to see if he can extract the purpose of a program from the code. If he can do so, he can figure out the format of the website.
so I pasted @jimmy codes to the console and that seems to work but how can you just tell me what I need to replace to get the next code
15:43
besides, if he would give the link I would do it for him
And give him the code of course
but thanks you have saved me time
before I would probably have to type out all 400 pokémon I want to have (IK there is 500+ but I only have sprites for 400 and I want to keep the data limit down)
but I'm yet to get the attack stats
user92578
do you need HP?
Oh... I got all the stats
Well, i did what typpi suggested and the code is still not generating proper bounds
private void create(TexturedModel model) {
	    Vector3f center = Vector3f.add(model.getMax(), model.getMin(), null);
	    center.scale(0.5f);

	    this.center = center;
	    Vector3f[] vertices = model.getVertices();
	    float length = Float.MIN_VALUE;
	    for(int i = 0; i < vertices.length;i++) {


	        for(int j = 1; j < vertices.length;j++) {
	            Vector3f v0 = vertices[i];
	            Vector3f v1 = vertices[j];

	            float tmp = Vector3f.sub(v0, v1,null).length();

	            if(tmp < length) {
15:52
@FreezePhoenix can you paste them somewhere?
or tell me the Jsquery code or something I can paste
var elements = document.getElementsByClassName("l");
var results = []
for (var i = 0; i < elements.length; i += 1) {
  var j = 0
  result[i] = []
  result[i][j] = elements[i].textContent
  var element = elements[i]
  while(element.nextSibling !== null) {
    j++
    result[i][j] = element.nextSibling.textContent
    element = element.nextSibling
  }
}
user92578
@TheMaskedRebel not what I suggested
there you go
@Tyyppi_77 that is the code that trusts the center
user92578
maybe 3rd time is the charm:
user92578
15:54
nwp
nwp
<(*.*)>
user92578
@nwp nonononono please dont confuse him
although I should filter result
so it doesn't have all these... return symbols
VM1030:5 Uncaught ReferenceError: result is not defined
at <anonymous>:5:3
user92578
Replace nextSibling with nextElementSibling
15:55
@nwp I wont trust the center XD
user92578
@TheMaskedRebel please do
unironically neeedsmorejquery.com
user92578
now the data is in another arbitrary format
well I put it in that format with the "join" because it's easier to look at
user92578
:) yeah that's cool, didn't know jquery was that neat
15:57
if you leave that out and add innerText.split() you get the array of arrays of text
@PintOfMilk
@FreezePhoenix yes
var elements = document.getElementsByClassName("l");
var results = []
for (var i = 0; i < elements.length; i += 1) {
var j = 0
result[i] = []
result[i][j] = elements[i].textContent
var element = elements[i]
while(element.nextSibling !== null) {
j++
result[i][j] = element.nextSibling.textContent
element = element.nextSibling
}
}
result.map( (item) => {
var r = item.filter( item => item.replace("↵", "") != "")
r = r.map( item=>item.replace("↵",""))
return r
})
That should get everything you need
Uncaught SyntaxError: missing ) after argument list
user92578
15:58
lol I did that mapping portion in sublime with search and replace lol
var elements = document.getElementsByClassName("l");
var results = []
for (var i = 0; i < elements.length; i += 1) {
var j = 0
results[i] = []
results[i][j] = elements[i].textContent
var element = elements[i]
while(element.nextSibling !== null) {
j++
results[i][j] = element.nextSibling.textContent
element = element.nextSibling
}
}
results.map( (item) => {
var r = item.filter( item => item.replace("↵", "") != "")
r = r.map( item=>item.replace("↵",""))
return r
})
00:00 - 16:0016:00 - 00:00

« first day (2869 days earlier)      last day (2447 days later) »