Sarbian changed the topic of #kspmodding to: Welcome to #kspmodding - the channel for discussing, and learning about, modding Kerbal Space Program. Code of Conduct: https://git.io/vSQh6 | Always provide logs. | *** PSA: https://kerbalspaceprogram.com/api/index.htm | Someone is writting a Phd dissertation on KSP modding please fill out this survey https://goo.gl/forms/1vrkPYH4az8l32sb2 - I have met him and it s legit
_whitelogger has joined #kspmodding
<taniwha> xShadowx: summation of the volumes of the tetrahedrons formed by each tiangle and the origin
<xShadowx> taniwha: thats blender's way?
<taniwha> afaik, it's the only way
<xShadowx> from googling, thats the fast/simple way, but only works on simpler objects like cube/sphere, where no tetraheda cross as they connect to the origin
<taniwha> no, it works no matter what shape the object is
<taniwha> just so long as it is /closed/
<xShadowx> the more expensive / slow way, is voxelize it, which is uber slow, but works for concave objects, such as humanoids, and horseshoes
<xShadowx> er
<taniwha> tetrahedrons works just fine for manifold objects
<taniwha> concave vs convex is irrelevant
<xShadowx> i made a cube in blender, got the vertex coords, math off website o calc volume, worked as expected, but then i divided 1 fce, moving the center vert to the oposite face, essentially making a square vase kinda shape, ran same math, and got an incorrect value
<xShadowx> while blender math is correct but no ideda the algorithm used :|
<taniwha> that's because of two reasons
<taniwha> 1) blender's math is not quite as accurate as it should be
<taniwha> 2) the cube is not quite as accurate as it should be
<xShadowx> 2) cube was perfect ;p polygons just intersected
<taniwha> er, and maybe 3) it sounds like you did something really weird
<taniwha> cube is NOT perfect
<taniwha> it is not +/- 1.0 on all axes
<xShadowx> the one i made was ;\
<taniwha> but rather 0.999999 and 1.000002 or something like that
<xShadowx> b/c floating point?
<taniwha> because of how the cube is created
<taniwha> it's a cylinder in disguise ;)
<xShadowx> when i selected verts, shows +/- 1 as coords
<SilverFox> wait up
<xShadowx> and volume checks out as 8 ;\
<SilverFox> a cube is a cylinder in disguise?
<xShadowx> yep ;p
<xShadowx> taniwha: anywho, so you're saying the tetrahra method should work fine on a humanoid shape?
<xShadowx> mesh is closed
<xShadowx> atleast best i can tell ;p
<xShadowx> tetrahedra*
<taniwha> yes, it will
<taniwha> but the mesh MUST be closed
<xShadowx> i tried the voxel way to calc and it was quite a bit slower ;\ so hoping to avoid that
<taniwha> and I just checked: blender does the right thing for my cubical cup
<taniwha> default cube, inset one face by 0.1, extrude it by -1.9
<taniwha> volume is 1.844
<xShadowx> oh i know blender is right, atleat using the volume from the 3d print tools
<taniwha> this is correct for 2**3-1.8**2*1.9
<SilverFox> taniwha, how the fuck you make a cube outta cylinder?
<xShadowx> i was saying the tetrahedra math was showing incorrect (no idea which method blender is using)
<SilverFox> do you just do weird face geometry?
<taniwha> SilverFox: 4 sides, radius 1.414, height 2
<SilverFox> why not just have a primitive cube type?
<xShadowx> move a vert out from center, extrude around the radius by 90 degrees per step
<SilverFox> why does it make sense to makeshift a shitty cube?
<taniwha> xShadowx: blender does use tetrahedra
<taniwha> xShadowx: make sure you're calculating your volumes correctly
<taniwha> (eg, make sure you're using negative volumes when you should)
<xShadowx> then why does every site i look at say tetrahedra method doesnt work for complex objects >.>
<SilverFox> wait up negative volumes
<taniwha> xShadowx: because every site you look at is wrong
<SilverFox> yall blowing my mind
<taniwha> SilverFox: no worse than negative areas :P
<xShadowx> download some more ram
<taniwha> simple calculus
<SilverFox> hol up
<SilverFox> >sImPle CaLCulUS
<taniwha> negative volumes and areas are the foundation of integration
<SilverFox> how does the square of something result negative?
<taniwha> I "got" integration the first lesson :P
<taniwha> (same for derivatives)
<SilverFox> is this some next level sqrt(i) shit?
<xShadowx> taniwha: does 'closed mesh' count as a 'cube' made of 6 faces, so 24 verts with its duplicates
<taniwha> negative area for a graph: graph is below the horizontal axis
<taniwha> negative volume: the object is inside out :P
<taniwha> (I guess the same goes for area)
<xShadowx> or would duplicate verts need removed?
<taniwha> duplicates do not need to be removed
<xShadowx> hmm so def a closed mesh
<taniwha> only that there are no gaps between adjacent edges or vertices
<SilverFox> well fuck me alright that makes sense
<xShadowx> ya, since just iterating the triangles, makes sense
<taniwha> xShadowx: closed means that if each face was made of glass, the object could hold water without leaking
<SilverFox> i'ma restore the peace and never message here for a few decades
<xShadowx> yar i get it
<xShadowx> just wasnt sure if needed all bits welded
<taniwha> SilverFox: and if you want fun sqrt(-1) stuff, go play with quaternions }:>
<xShadowx> put 2 sheets of glass together - water finds a way through ;p
<SilverFox> hell naw
<xShadowx> fuck quats
<SilverFox> quats can suck a dick
<SilverFox> aint delving into no voodoo magicks
<kmath> YouTube - What are quaternions, and how do you visualize them? A story of four dimensions.
<taniwha> watch that
<xShadowx> i understand quats, i still say fuck quats ;p
<taniwha> xShadowx: ah, but do you get 4d rotations? :)
<taniwha> with that, the classic rotating 4d cube actually makes sense
<xShadowx> do you get my desire to put you into a rocket aimed at the sun? ;p
<taniwha> you'd miss :)
<xShadowx> nahhh i installed MJ
<taniwha> you'd miss in a big way
<xShadowx> the volume you were using in blender, from the 3d print tools?
<taniwha> no, mesh: volume tools addon
<xShadowx> hrm included?
<taniwha> yes
<taniwha> just need to enable it
<taniwha> my mu addon has its own, too (for various reasons, including improved accuracy)
<xShadowx> not seeing in mesh section
<taniwha> use search option
<taniwha> vol is sufficient
<xShadowx> nada
<taniwha> weird, it's been in blender for years
<xShadowx> tried mesh, nada
<taniwha> er, or maybe not
<taniwha> it's in my local addons dir
<xShadowx> :p
<xShadowx> i gotta remake it in c# ;\ thatll be fun to read python which i hate
<taniwha> if you're going to make a new one, don't use that one
<taniwha> use the one in io_object_mu
<xShadowx> better?;p
<taniwha> yes
<taniwha> calcVolume
<xShadowx> all the verts are listed as floats, so i could prolly get away with double/decimal to raise acc lol
<taniwha> won't help as much as you would want
<xShadowx> :|
<taniwha> good algorithm and sorting is the main key
<xShadowx> er sorting?
<taniwha> yes, when doing a big sum, you want to start with the smallest magitude values and work your way up
<xShadowx> wouldnt it just be sum every tetrahedron
<xShadowx> er why o.O
<taniwha> reduces problems due to disparate magnitudes
<xShadowx> b/c floating point math?
<taniwha> think of the difference between adding 0.01, 0.09 and 0.9 when you have only 1 digit of precision
<taniwha> (and adding 0.9, 0.01, 0.09)
<taniwha> (hmm, might not be the best example)
<xShadowx> sure, but then if using doubles instead of float, you open it to have more digits of precision
<xShadowx> which wouldnt that negate it?
<taniwha> yes, but why waste those digits?
<taniwha> no, it doesn't negate it, just move it around a bit
<xShadowx> its only a temp value o.O
<xShadowx> ah
<taniwha> ironically, despite the blender default cube being slightly wonky, it is still exactly 8.0m^3
<xShadowx> sorting 1mil values is gonna suck tho ;p
<taniwha> but mesh_volume_tools doesn't think so
<xShadowx> heh
<taniwha> qsort :)
<xShadowx> basicly trying to calc volume of a humanoid figure, 1mil poly
<taniwha> also, 4GHz machine :)
<SilverFox> what processor?
<taniwha> and even more: you can split up the task and run it in multiple threads
<taniwha> then add the sub results
<taniwha> SilverFox: who cares? it's 4GHz compared to 4MHz
<xShadowx> still a ton more work to sort ;p
* taniwha wonders if SilverFox remembers when 4MHz was /FAST/
<SilverFox> lmao them pentium processors
<SilverFox> wasn't that pentium 2 or 3?
<taniwha> pentiums started at 60 or 66MHz
<xShadowx> what +/- % error amount you think there is from not sorting?
<taniwha> p2 was 150-200 iirc
<SilverFox> i think arduinos run at 4Mhz
<xShadowx> 16mhz
<SilverFox> the mega runs at 16
<taniwha> xShadowx: probably not too bad if your faces are not randomized
<taniwha> ~800kHz was considered fast :P
<xShadowx> taniwha: know whatll really suck? i gotta load not only the 1mil poly char but about 500 morphs with it lol
* xShadowx waves bye to his ram
<taniwha> ah, Lode Runner on an 800kHz cpu :)
<taniwha> one at a time
<taniwha> hmm, however
<taniwha> 1Mpoly -> ~1Mvert -> 12MB
<taniwha> so 700MB
<xShadowx> how you figure 12mb?;p
<taniwha> could fit it in your GPU :P
<taniwha> 3 floats per vert, 4 bytes per float
<taniwha> oh, forgot normals etc
<xShadowx> you forget a mesh needs triangles for its faces, to say what verts connect to what
<taniwha> they're ints
<taniwha> 12 bytes per face
<taniwha> and most verts will be shared
<xShadowx> its still list 3 verts per face
<taniwha> yes, but using vertex indices
<xShadowx> 1mil faces
<taniwha> thus 3 ints per face
<xShadowx> yep
<xShadowx> so 12mb there
<taniwha> but for a closed surface, your vertex and face count will be close
<taniwha> so 24MB
<xShadowx> then the normals, vector3, another 12mb
<taniwha> yeah
<taniwha> UVs another 8MB
<xShadowx> so 36mb
<xShadowx> 44mb
<taniwha> still not going to hit 10GB
<xShadowx> funny thing is i loaded 1mil poly version into unity, took a couple seconds to read it all
<taniwha> also, 500 morphs seems excessive
<xShadowx> 4mil version, it craps out for 2 hr lol
<xShadowx> that 500 morphs only moves the verts that move
<taniwha> oh, last I heard, unity uses shorts (16 bits) for indices, not ints (32 bits)
<xShadowx> so no junk data
<xShadowx> idk o.o
<xShadowx> i just know it works ;p
<taniwha> still, you sure it's morphs and not bones?
<xShadowx> yep
<xShadowx> b/c i have to export a 1mil poly obj for every morph target lol no bones included
<taniwha> and... humanoid models are never 1Mpoly for games
<xShadowx> ya funny thing
<taniwha> low-poly versions are used
<xShadowx> i always heard 2-5k
<taniwha> (with texture baking and the like)
<xShadowx> i goto the game markets, models are 2-5k
<Rokker> reeeeeeeee stop pinging me
<xShadowx> i look a unity, im running 90fps on a 4k mesh
<xShadowx> so i get the idea
<taniwha> the 1Mpoly models are used for baking normal maps etc into the low-poly models
<Rokker> reeee
<SilverFox> Rokker, why ping?
<xShadowx> goto an old market i used to use for 3d animation / stills
<xShadowx> i got a nice 1mil poly model thats uh.......detailed
<Rokker> poly pings me
<xShadowx> best part, universal base mesh
<taniwha> xShadowx: that's not a production model
<taniwha> that's a pre-production model
<SilverFox> why
<taniwha> used for baking
<xShadowx> the site sells 'characters' as morphs for the base mesh'
<taniwha> becaus Rokker wants crackers
Rokker has left #kspmodding [#kspmodding]
<xShadowx> no
Rokker has joined #kspmodding
<Rokker> reee
Rokker has left #kspmodding [#kspmodding]
<xShadowx> thats a model used for high detail for 3d art
Rokker has joined #kspmodding
<taniwha> same thing
<xShadowx> so i loaded the 1mil poly char
<Rokker> its because I moderate a channel that bans politics and they tried using poly ticks to hide it from me
<xShadowx> unity running 90 fps still
<Rokker> SilverFox: ^
Rokker has left #kspmodding [#kspmodding]
<taniwha> xShadowx: because it's been moved to your GPU
<xShadowx> i havent tried between 1 and 4 mil poly though as said 4mil craps out, and getting between there isnt much of an option for that universal mesh
<xShadowx> indeed ;p
<xShadowx> so morale of the story is 1mil poly works just fine for m,e ^.^
<SilverFox> lmao
<taniwha> xShadowx: your GPU probably doesn't have enough memory
<taniwha> (I suspect might might not, but my CPU does)
<taniwha> xShadowx: but you're not doing anything with the model
ferram4__ has joined #kspmodding
<taniwha> er, I suspect my GPU might not
<taniwha> 64GB system memory
<taniwha> not sure how much GPU memory
<xShadowx> thats with the model moving and walking and jumping
<xShadowx> i got 64gb system, 8gb gpu
<taniwha> 8GB
<xShadowx> well....128gb system, but 64 is 'system' and 64 'ramdisk'
<taniwha> my MB capped out at 64
<xShadowx> ssd slow :|
<taniwha> yes, ssd is slow
<xShadowx> mine capped 128 lol
<taniwha> not worth the money, imo
<taniwha> you got yours more recently than I got mine
<xShadowx> ram was cheap when i got it
<taniwha> (mine's about 2yo now)
<xShadowx> mine 2 yr too
<xShadowx> well
<xShadowx> 2yr in 3 months
<xShadowx> got it at black friday
ferram4_ has quit [Ping timeout: 183 seconds]
<xShadowx> or black week......now black november
<taniwha> hmm
<taniwha> wonder how long mine was sitting on the shelp
<taniwha> ...
<xShadowx> but ya ram wasnt that bad
<taniwha> shelf
<xShadowx> i dont even know how long mine was out either
<xShadowx> i just went for core i7, found parts, done ;p
<taniwha> yeah
<xShadowx> taniwha: and read priv :)
<xShadowx> from googling, does mention a 65k limit on polys for stuff, that must be for the 16 bit indices
<xShadowx> yet 1mil poly works, so maybe its adjusting to 32bit indices?
<xShadowx> still 12+12+12+8=44mb for 1mil vert/poly/normal/uv
<xShadowx> gpu is 8gb......shouldnt i be able to go higher? ramwise anyways
<xShadowx> that 44mb seems tiny ;\
<taniwha> 22GB at 500 morphs
<xShadowx> not all verts are used every moprph
<taniwha> not all verts are /moved/
<xShadowx> average prolly 10% ish random guess
<xShadowx> ya, unmoved arent stored
<taniwha> don't count on it
<xShadowx> ? i loaded them, i know they arent o.O
<taniwha> your verts are considered innocent of pruning until proven guilty :P
<xShadowx> the data isnt there
<xShadowx> lol
<xShadowx> anywho, even ignoring the morphs, 44mb seems tiny
<xShadowx> but 4mil poly killed unity -.-
<taniwha> yes, 0.044bits is tiny
<xShadowx> i gotta see how much unity accually uses up loading that
<xShadowx> shush ;p
<SilverFox> how do you have <1 bit?
<xShadowx> 538Mb for unity when no model, 3,475Mb with model used once, 2nd copy no addition gain as expected
<taniwha> SilverFox: makes sense when it's bits/something
<xShadowx> so 2,937Mb used for 1mil poly.......why isnt it 44Mb
<SilverFox> potentially
<taniwha> eg, 0.044bits/second
<taniwha> 22.7s to transmit a bit
<taniwha> sounds like some satellite data services :P
* xShadowx lights taniwha's chair on fire
<xShadowx> gpu ram gets about the same usage spike
<xShadowx> so whys it eating mah ram and not using 44Mb
<SilverFox> yeah
<SilverFox> or a super-encrypted stream
<xShadowx> no morphs loaded, just base mesh, no bones, no materials assigned
<xShadowx> wth >.>
<xShadowx> i mean it runs fine.....not the point
<xShadowx> just where dafuq my ram ;p
<SilverFox> ~wa 466.59 + 66.19 USD to CAD (nocache)
<SilverFox> damnit
<xShadowx> !wa 1 USD to CAD
<xShadowx> aw
<xShadowx> bot died?
<xShadowx> wait what was qboid again >.>
<xShadowx> !wa usd to cad
<Qboid> xShadowx: convert $1 (US dollar) to Canadian dollars: C$1.28 (Canadian dollars)
<xShadowx> then why no worky when 1......
* xShadowx kicks Qboid
_whitelogger has joined #kspmodding
_whitelogger has joined #kspmodding
ferram4__ has quit [Read error: Connection reset by peer]
ferram4 has joined #kspmodding
ferram4 has quit [Read error: Connection reset by peer]
ferram4 has joined #kspmodding
_whitelogger has joined #kspmodding
oeuf has joined #kspmodding
VanDisaster has quit [Ping timeout: 202 seconds]
egg has quit [Ping timeout: 202 seconds]
_whitelogger has joined #kspmodding
_whitelogger has joined #kspmodding
_whitelogger has joined #kspmodding
hashashin has joined #kspmodding
egg has joined #kspmodding
oeuf has quit [Ping timeout: 200 seconds]
Lyneira has joined #kspmodding
VanDisaster has joined #kspmodding
hashashin has quit [Read error: Connection reset by peer]
hashashin has joined #kspmodding
hashashin has quit [Ping timeout: 200 seconds]
Ezriilc has joined #kspmodding
hashashin has joined #kspmodding
VanDisaster has quit [Quit: Miranda NG! Smaller, Faster, Easier. http://miranda-ng.org/]
VanDisaster has joined #kspmodding
hashashin has quit [Ping timeout: 200 seconds]
Lyneira has quit [Quit: Bye]
<xShadowx> taniwha: reading more, looks like what the volume calc is doing, if using vector functions, vol = v1.Dot(v2.Cross(v3)) / 6.0f; i think?
<xShadowx> then your function was doing is drop the /6.0f, just store all the values, sort at end, sum, and a single /6.0f?
Ezriilc has quit [Quit: Going offline, see ya! (www.Kerbaltek.com)]
<xShadowx> er..now im confused...... mesh.tiangles is int[]
<xShadowx> triangles*
<xShadowx> ohhh....thats silly, triangles[triangleindex * 3 + 0to2] to get v1 v2 v3
<xShadowx> but then no vector3 equiv for int :| to store vertex indices
<xShadowx> i woulda thunk maybe a Triangle struct to hold v1 v2 v3