Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
HoboMan
Nov 4, 2010

Luigi Thirty posted:

can someone help me out with my rasterization routine?

code:
        //screenCoords[i] = vector between <(-1,1),(-1,1),(-1,1)>

        //Perform scaling. The screen is (-1,1) along the X and Y axes.
        float scaleFactor = 50.0f;
        screenCoords[i].x = screenCoords[i].x * scaleFactor + SCREEN_WIDTH/2;
        screenCoords[i].y = screenCoords[i].y * scaleFactor + SCREEN_HEIGHT/2;
    }
this obviously is the equivalent of a super-tight FOV. how i calculate 90-degree fov :saddowns:

e: oh wait that's a plus, so i'm wrong

e2: how far is the camera from the vector? Also what is this <(-1,1),(-1,1),(-1,1)>? three points in a plane?

e3: you mean a line segment from (-1, -1, -1) to (1, 1, 1) and the camera is at (-1, 1, 0) where points are (x, y, z)?

e4: regardless i'm p sure your scaleFactor needs to be multiplied by SCREEN_WIDTH and SCREEN_HEIGHT respectively (also be made like .2 or some poo poo in that case)

HoboMan fucked around with this message at 04:23 on Jul 12, 2016

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

HoboMan posted:

e: oh wait that's a plus, so i'm wrong

e2: how far is the camera from the vector? Also what is this <(-1,1),(-1,1),(-1,1)>? three points in a plane?

the screen is 320x200 so SCREEN_WIDTH and SCREEN_HEIGHT are 320 and 200 respectively

screenCoordinates is a vector containing an X and Y each between -1 and 1 which right now gets multiplied by a scale factor to produce pixel coordinates. the Z coordinate is for the Z-buffer.

HoboMan posted:

e3: you mean a line segment from (-1, -1, -1) to (1, 1, 1) and the camera is at (-1, 1, 0) where points are (x, y, z)?

e4: regardless i'm p sure your scaleFactor needs to be multiplied by SCREEN_WIDTH and SCREEN_HEIGHT respectively (also be made like .2 or some poo poo in that case)

the center of the screen is (0,0,0), this is well after we've done the camera transforms and everything

i might be doing this wrong

https://github.com/Luigi30/polygon/blob/master/framebuffer.cpp#L152 here's the whole function for context

Luigi Thirty fucked around with this message at 04:26 on Jul 12, 2016

cinci zoo sniper
Mar 15, 2013




luigi idk if youve seen http://ogldev.atspace.co.uk/www/tutorial12/tutorial12.html

Luigi Thirty
Apr 30, 2006

Emergency confection port.

oh scaleFactor is just way too low

HoboMan
Nov 4, 2010

basically

hope i was mildly helpful

HoboMan fucked around with this message at 04:42 on Jul 12, 2016

Luigi Thirty
Apr 30, 2006

Emergency confection port.

you were and I more or less solved my FOV problem

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

:eyepop:

GameCube
Nov 21, 2006

Luigi Thirty posted:

https://github.com/Luigi30/polygon?files=1

The code is mega uggo tho (and you need Open Watcom to compile it)

hell yes!!!

GameCube
Nov 21, 2006

oh yeah at 3 am i figured out what i needed to do with that queue thing to maintain order without having some other thread read from the queue. everything in the queue gets a semaphore initialized to 0. everybody who wants to do the thing waits on the semaphore for their thing in the queue. whenever something's dequeued, it signals the next thing. and if the queue is empty, the next thing enqueued is immediately signaled. the end

this already exists, doesn't it

tef
May 30, 2004

-> some l-system crap ->
this is easier if you put the readers in a queue too

while next = blocking_list_of_stuff.pop {

worker = blocking_list_of_workers.pop
worker.process(next)
}

skimothy milkerson
Nov 19, 2006

did anyone say monads and strife yet

HoboMan
Nov 4, 2010

GameCube posted:

oh yeah at 3 am i figured out what i needed to do with that queue thing to maintain order without having some other thread read from the queue. everything in the queue gets a semaphore initialized to 0. everybody who wants to do the thing waits on the semaphore for their thing in the queue. whenever something's dequeued, it signals the next thing. and if the queue is empty, the next thing enqueued is immediately signaled. the end

this already exists, doesn't it

i'm doing a similar thing and the only class that looks related that i found so far is ConcurrentQueue

this really does seem like a class that would exist though so if anyone know what it is that would be very helpful

e: also what the heck is this?
C# code:
object[,]
tia

HoboMan fucked around with this message at 15:02 on Jul 12, 2016

GameCube
Nov 21, 2006

tef posted:

this is easier if you put the readers in a queue too

while next = blocking_list_of_stuff.pop {

worker = blocking_list_of_workers.pop
worker.process(next)
}

i don't even have any readers, even though i should. i think. idk. i just want multiple calls to this api from different threads or tasks maybe? to be executed in order

jony neuemonic
Nov 13, 2009

HoboMan posted:

e: also what the heck is this?
C# code:
object[,]
tia

multidimensional array.

GameCube
Nov 21, 2006

uggggh why is httpclient giving me these freakin 404s. why. it's not even reaching the server!! the gently caress

HoboMan
Nov 4, 2010

GameCube posted:

i don't even have any readers, even though i should. i think. idk. i just want multiple calls to this api from different threads or tasks maybe? to be executed in order

your threads are the "readers"

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

GameCube posted:

oh yeah at 3 am i figured out what i needed to do with that queue thing to maintain order without having some other thread read from the queue. everything in the queue gets a semaphore initialized to 0. everybody who wants to do the thing waits on the semaphore for their thing in the queue. whenever something's dequeued, it signals the next thing. and if the queue is empty, the next thing enqueued is immediately signaled. the end

this already exists, doesn't it

it definitely does in posix but i think youre in .netland if i remember right?

GameCube
Nov 21, 2006

HoboMan posted:

your threads are the "readers"

yeah but they're like... just async functions awaiting on stuff. idk this thing seems to work.

LeftistMuslimObama posted:

it definitely does in posix but i think youre in .netland if i remember right?

iirc (probably not) posix semaphores will make threads wait their turn but not .net

GameCube
Nov 21, 2006

now this freaking httpclient is throwing 404s without even trying. i'm using mitmproxy to watch the traffic and it's just not happening. wtffffff

i must be holding onto some resource cuz the first request succeeds and then every request after that fails. hmm

HoboMan
Nov 4, 2010

404 means it's not there, when i was debugging an API earlier it always meant the service was not running

HoboMan
Nov 4, 2010

ok so i'm benchmarking parallelizing this thing but the parallel version seems no faster (some runs were slower even)

AWWNAW
Dec 30, 2008

it can definitely be slower depending on what you're parallelizing

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i made a house



it crashes after ~30 seconds with a stack overflow lol

GameCube
Nov 21, 2006

HoboMan posted:

404 means it's not there, when i was debugging an API earlier it always meant the service was not running

lol i know what 404 means. i'm intercepting the traffic with mitmproxy (very good and cool) and the request isn't even going out! wtf!!

and i know the service is running because i am running it, on my computer. freaking microshafted again. it is impossible that my code is wrong.

Bloody
Mar 3, 2013

fiddler is probably better!!

Bloody
Mar 3, 2013

i really like fiddler because it coerces lovely linux programs that use bad proxy unaware interfaces into working with our mega enterprise corporate proxy

GameCube
Nov 21, 2006

fiddler required me to set a registry key and restart the app in order to do reverse proxy. lomarf. anyway i did already try that since mitmproxy's console ui only works (and poorly) in cygwin if you're on windows... but the same freakin thing! what gives!!

MononcQc
May 29, 2007

Finally had to resort to git bisect today. It was less painful than expected.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
We're apparently considering a move off of svn! Yay!

Bloody
Mar 3, 2013

to cvs?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

I heard they're researching whether git or mercurial will integrate better with our existing tools.

tef
May 30, 2004

-> some l-system crap ->

LeftistMuslimObama posted:

I heard they're researching whether git or mercurial will integrate better with our existing tools.

the answer is that mercurial is waaay easier for svn users to pick up and some of the third party tooling is similar

all the cool people use git though

really cool people have a special git config and workflow tools and they will talk about them

Shaggar
Apr 26, 2006
git is so bad

Sapozhnik
Jan 2, 2005

Nap Ghost

Shaggar posted:

git is so bad

it's a bit sucky, but the better (hg) is the enemy of the good (git)

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

GameCube posted:

uggggh why is httpclient giving me these freakin 404s. why. it's not even reaching the server!! the gently caress

one time my urls got so long that the client i was using just started giving 404a

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Mr Dog posted:

it's a bit sucky, but the better (hg) is the enemy of the good (git)
i'm going to be replacing a windows 2003 server that hosts nothing but an old version of visualsvn for a bunch of .net 4.0 programmers who use visual studio 2005/2008. as a computers janitor, do i want to suggest replacements to the developers for this product, or do i just want to drop in a newer version of visualsvn and have them take it from there?

tef
May 30, 2004

-> some l-system crap ->
tbh, if you're moving olds from svn, hg is pretty ok and not a huge jump, the interface is very similar (you commit, but now you push and pull) and there's usually 1-1 mapping from one command to another

with git, well what you did in svn can be done in 20 different and arcane ways, but it does the job and ~everyone~ uses github or so i'm told

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
git really is shamefully bad

maybe it's good at what it was designed to do, but as someone who doesn't mail Linux patches around how would I ever know

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
i've heard that to understand git, you should read some book "git from the ground up" or something like that.

to understand mercurial, i just had to read the manual.

of course everything everywhere uses git, so you need to learn it anyway.

a partner complained to me about using mercurial instead of git about 6 months ago in our company's projects. i told him that before i came to the company, there was no version control at all and the development and production server code had already started to drift apart quite significantly and mercurial was the one i could understand at the time. this happened in 2010

Adbot
ADBOT LOVES YOU

Asshole Masonanie
Oct 27, 2009

by vyelkin
git is extremely easy and i really have even more trouble understanding ho0w a bunch of programmers don't understand it but i guess this is the terrible programmer thread after all

  • Locked thread