Tuesday, March 31, 2015

Recent focus on hypocrisy for corporations doing business with those engaged in restricting the rights of gays

   Recent commentary, it would appear by so called 'freedom restricting' advocates actually reminded as of an age old problem and likely easy source for hypocrisy accusation, namely pointing out the often times muddled ethical stance given by businesses in their typified dealings.  As Tim Cook recently spoke out against the passage of laws in Indiana, 'discrimination rights' defenders on the right spoke out against Apples transnational practices in dealing with big human rights offenders on this very issue.  Of course, I recall the quandary given by IKEA in an given radio article piece on NPR so many months ago, in discussing the at times tension given matter having an open shop in Russia as the status of gay rights were in decline while IKEA were so much openly promoting to tolerance in their own work place.  Of course, in doing business, it always raises the question when is enough enough in doing business, or as likened to strategic change in foreign policy when does suffering others economically by not doing business actually work counter intuitively to the process of promoting social change.  On the other hand, the stick punishing approach to business says if you want opportunity then maybe considerations of change with respect to social policy promotes advocacy, while on the other hand, neither fully removing carrots seem promotes relation and exchange, and something certainly defining a natural inter dependencies exchange.  On the other hand, I don't know that, despite potential hypocrisy, that I fault Tim Cook as much either in speaking out as an advocate here against Indiana laws.  After all, Indiana is more so on Tim Cooks doorstep as is Indiana for us all whom call ourselves Americans, and at times feel passionate in speaking our piece or given to what ever activism that we compels us, and it seems while progress is made in advancing and asserting an ever changing awareness with respect to the nature of law and ethics in defining what must have seemed un imaginable decades prior defines a new world believed more strongly to the notions that each and everyone should have a fair opportunity at life, and be given fair opportunities in life to participate in a given marketplace.   Its hard to see that a 'freedom' again is so if it is restricting the rights of others...after all those 'killing' in the name of God might in some warped manner define their 'right' as 'freedom'.

    I can't prognosticate what the laws in Indiana might do in so far as its own business and economy in general, but likely I imagine relative to all other states in this country neither having defined such laws, and neither as of recent history having enacted or defining such laws, would likely any feel exactly comforted by the situation of 'freedom restricting' measures existing, or in other words, business in some ways I imagine may continue in the state of Indiana in so ways and decline I imagine in other ways.  I, for one, do feel less personally comfortable by the formalized existence of legal discrimination, one because it is more clearly defined and given legal shelter in so far as social practices are concerned, even if naturally legally unchallenged cases had emerged prior in any number of instances.  On the other hand, Indiana, like Kansas and any number of states, particularly in the South, appear to be a case of any number of states that one should imagine are less desirable by those only from the other states where social tolerances for people are greater not less so.  At least overtly when laws are in place and slated towards the application of discrimination, its hard to see this as a good sign.   Whether this were a growing generational cultural trend, or whether the state of Indiana signals something of a potential growing rift in the GOP in the future I imagine remains to be seen.  Although likely one should imagine this country isn't the same country relative to decades prior, at least revivalism to discrimination movements, anti immigration, and anything else that has managed to wind up in GOP present populism trend may actually end hurting the party in the long run, if not with potentially some generation of younger voter but also those having felt even more so alienated by its hijacking for the hoodwink culture wars.  Sure Indiana is not alone by itself but maybe only another step likely towards a newly defined civil rights stand off in the future. 

Sunday, March 29, 2015

Knee jerk politicking and bad laws

Today's politically constructed social "religious" laws are likely the forgotten and abandoned of tomorrow.

Such laws not even, one should imagine, having the tenure of the discriminating/hate laws passed in a previous century, but given by every opportunity to take something in exchange by way of passage, any of these laws appear to be mostly reserved for the ignorance of one but not often more than one party.  


On February 13, 2007, the Board voted 6 to 4 to reject the amended science standards enacted in 2005. The definition of science was once again returned to "the search for natural explanations for what is observed in the universe."[79]
Important since the legacy of a board's passage lasted approximately 2 years before being rescinded.  Much of this coming from the concerted efforts of groups or organizations, perhaps, neither indigenous to the state of Kansas that managed to lobby an effort but apparently were neither able to sustain what arguably were nothing more than a once risen populist movement that went as quickly as it entered onto a given stage.  

Outside of anti gay laws, anti immigration, and gun laws are pretty much at the current fore front of the GOP's radar it would seem at times.  Any number of knee jerk anti immigration laws passed in the south, appear in any number of cases terminal for any number of reasons, but must arguably because they are poorly written and not sustainable and entirely for political expediency.  Amazing that people as quickly forget the hood wink of 'three strikes and you are out'...what happened to all the backing politicians on that one?

But love and faith one should hope are not exclusive, exclusionary, and only self permitting?

Blindly given that one group of peoples practicing sodomy, happenstance, actually choose a target that never actually practiced in one's life time the act of sodomy but is so much the excuse of bigoted laws!

It seems that one lives in a strange world composed of people that turn blind eyes to their golden children but never miss the opportunity in creating the devil in what must seem the devil to them!

In history this goes something to tune stamp out the sins of the upper classes in the lower ones!

Saturday, March 28, 2015

http://www.theguardian.com/education/commentisfree/2015/mar/23/philosophy-white-men-university-courses#comment-49450919

I wish this article provided more with respect to what in many peoples minds should be an offering given to ease.

In a layman's surface approach to this topic, it seems the evolution of philosophy could be rife at times with a given self reaction and speculation with respect to civilizations past.  The center of philosophical thoughts point to the inherent biases and predispositions of those civilizations, perhaps, in some way, if it is such that thoughts are not oriented at times in some highly abstracted manner.  I feel at unease, for instance, speaking of the process by which thoughts are abstracted in the characteristic way that this follows some bias of gender or race, as though the circle had the orientation of a male, if it were hard in seeing something clearly phallic by design, for example, and having played a central role in the formation of some philosophical thinking.  While in modern science, studies have been offered indicating predisposition of cultural/gender biases in so far as the gravity of gender in playing a role shaping predominant occupations found later in life, if it is not only by way of cultural reinforcements, problematic to this picture, it seems one might ask if not something even more inherent or intrinsic by nature which is genetics.  Not all, for instance, have desire to think in certain ways, although I eschew outright the notion in proclaiming exactly what is responsible and who are intrinsically given to certain occupation.  Hopefully more so in this age and any future age, only whatever biases against a woman, for instance, or an individual of any race are only less so.  Personally I see great wealth in tapping the synergy of a broader population of peoples, irrespective of race and gender.

    In relating this problem, it seems also asking if a notion of self similarity and social conformity defines pre occupation in thoughts, in mind.  For instance, considering the mindset and culture given to likelihoods of pondering over a course of abstractions that seem less outright meaningful in a given everyday context to some in another world, gives rise to the self evidence role of environment shaping mindset.  If to examine race and gender on the basis of philosophy alone, I think potentially misses the nature and role of any given contribution.  Nonetheless, it is also another complex matter on the valuations appropriated by any group or body of individuals deciding what contributions need be passed to any future generation in a given civilization(s), and yes predominantly given by a body largely, one might suppose, composed of white men.

    Despite incentives that may be given in preference to providing advantage, for instance, women in a given workplace, it seems over coming gender gaps are still problematic in certain occupational spheres. More so I wonder if confronted the rigors of social reinforcement are not founded at some earlier age here, in so far as gender and racial biases.  Then it seems if one wanted to raise more women to be scientists, philosophers, mathematicians, for instance, I wonder if our culture needs to start at earlier ages.  I wonder if focus on later academics are a bit misguided?   In other words, I think that better outreach should be occurring all along.  Although I wonder as to the nature of how philosophy is defined in accepting any given philosophical works, it seems another ambiguity is left in the article here, namely, in referencing the lack of contribution, whether definitions are less restricted in defining what is of importance to a given branch.   "Modern Philosophy" for instance with a Google News search has yielded articles focused on Emeril Lagasse from my vantage.  Of course, while it seems the subject matter of Lagasse is more on cooking, or if having fallen into an epicurean subset of philosophy, or at least more pointedly those seeking pleasure pursuits in defining meaningful existence.  It seems parsing what is important, and not having been merely reformulated as restating another philosophy serving some role in passing to future generations a teaching on the matter of philosophy.  No objections to Lagasse here either.  

Thursday, March 26, 2015

An affront to the notion of freedom

http://www.nytimes.com/aponline/2015/03/25/us/ap-us-xgr-religious-objections.html

I say this only because in the past, this same political social movement wouldn't characteristically hide behind the language of a belief system, for instance, deciding that discrimination against some one of different sexual orientation because they had 'chosen' a given existence, but happenstance, in the age old racist/discriminatory view, such differences were so intrinsic as to define someone as being subhuman or not fully human.  Of course, in the modern legal view of things, these views are easily challenged, put down, thrown out of courts, at least for a given modern view having embraced all manner of sciences, philosophy, and legal reasoning alone, it would seem guidance to better thought were not so much to greater ignorance.

It could be well reasoned that the phenomenological nature of sexuality is neither given in so clear cut binary ways as has been argued by many in the sciences, and what should be clear cut intrinsic human behavior defined by environment versus genetics is not a given, or at least in airing to the side of legal conservation, one at least argues the point that in such an age, of course, it is possible, that one's genetics may strongly play a role in describing, yes, sexual desires.  It is, of course, the same role of genetics, that describe why some children despite best parents to break carbohydrate fixations, manage to find their children gravitating yet to such carbohydrates, or at least why, irrespective of parent's having certain predominant characteristics, find an odd duck of an offspring in the mix.  Of course, conveniently in all other spheres of life, it seems more quickly one might find others embracing the notion, that yes, maybe I shouldn't be punished for the sin of consuming too many carbohydrates, or at least potentially I were born with more strongly predominant genetic characteristics that had one gravitating to certain preferences in life relative to others, and when so predominant, moving against the grain were essentially moving against the grain of one's biology.  Obviously, and then there is much unstated about what preferences in life one shouldn't versus should have, and so much more potentially the freedom providing one's respect for the freedom of others, and such freedom in essence is given by the right to self existence.

Certainly if it is that the matter of behaviors of another inhibit or violate the freedoms of others, it seems legal tolerance should wane.  Thus potentially violent genetic predispositions may neither be considered beyond the scope of legal tolerance in so far as personal actions.  On the other hand, that a free democracy would tolerate the control and stricture on every day choice and preference of its own citizens, when such choices are neither given to impacting direct harm or clearly violating the rights of others is an anathema to free and democratic societies.

I hope in time our courts nationwide will only further bolster and affirm conservatively the rights of people irrespective of sexuality, its an affront stating that discriminating and restricting the rights of others should be a protected 'freedom'.  

Wednesday, March 25, 2015

Blender script with batch neighbor face selections routine for operators application

This code can be found also at this link:

At the moment I have a non coordinate based routine for batch selecting face groups...this is probably the most interesting and complex part of the algorithm.

I've extended this now to two dimensions on a given mesh surface, but at the moment selection routines on a given 2d surface are limited to 2x2 polygons(faces).

I may work on a NxN generalized case in time here.

Sort of thinking of this problem also as a base selection routine (as in number theory) extending a 2x2 selection to some number n which is compromised of some multiple of the 2x2 coupled with a remainders algorithm (for the odd case as opposed to the even case).  The selection routine is nice since it is non coordinate based, and can arbitrarily use any corner point as a start to the loop algorithm which fills in the rest of the selection grid.  It uses in this case a 'sensing' mechanism to sense direction without actually checking coordinates.  Logically this 'sensing' is typified by occupancy relations...that is occupancy in so far as neighbor face relations in comparing as set of potentially fuzzy or ambiguous choices.  The algorithm is tested mostly for even subdivision meshes, meaning that a 2x2 grid, for instance, evenly divides the surface.

https://github.com/christophermoverton/BlenderPythonScripts/blob/master/insetextrude.py

Tuesday, March 24, 2015

DirectTV ads really working despite Rob Lowe's presence?

  Or so it would seem the campaign to convert people over to a well used technology that may not actually represent the best service for a given consumer, but why so?

Well as you might believe, given that we, for instance, in commercial aviation planes use GPS technology which itself were given from satellite technology, that consumer commercial satellite technology more commonly used in broadcast should be a great deal for consumers, and as it stands similarly the same might have been said for satellite cellular communications service.  As it turns out in the later case, apparently poorer infrastructures investment coupled to the rapidity of technological advance and then also relating, for instance, others like orbital insertion of a given satellite payload followed by limited lifetime of a given satellite, for instance, had proved more costly in the wireless communications model relative to ground based distributed infrastructure which proved to be the predominant model for wireless communications in general.  As it turns out while cable providers, in part might receive recorded broadcasts still via commercial satellite technology in this day, on the other hand, it would appear the vast consumer subscriber base for television services are actually in cable, and likely in the future, one should imagine both ground based wireless and wired services as the predominant infrastructural model.  As it turns out, despite, for instance, Direct Televisions advertising campaigns, arguably the industry has suffered in consumer subscription losses where despite campaigns made touting cutting edge consumer subscription service, actually could be speaking to lack luster consumer incentives in terms of subscription, and maybe this could be owing to the more problematic aspects of satellite technology and actually upgrading this in general.  If it is more expensive to put up new technology in the sky relative to ground based deployment costs, it seems satellite technology could be at some disadvantage relative to other consumer subscription service types.  As to commercial's attempting to make unfair comparisons in a given market place, it seems there could be likely as much deception involved.  Where poor decision making reigns it seems, isn't merely given for instance, by choice of food alone, but it seems the state of California suffers from this inherent problem, a state that Rob Lowe by choice in either duplicitous form occupies in so far as the greater food production problem.

Update:

Apparently, Rob Lowe ads have been slated for the pulling, yet claiming effectiveness (personally I highly doubt such claims).  Then Rob Lowe claims as much being the 'subversive', or merely classically resorting to at times cultural biases, stereotypes or anything that other 'subversives' might have spent centuries in fighting against.  

Monday, March 23, 2015

Unidirectional batch inset processing with batch extrusions python script in Blender

import bpy
##this continguous strips of selected faces should be unidirectional
## and be non contiguous in the orthogonal direction in single face sequences along the user specified direction
##a modification of the code could be applied for processing squares of selected faces possibly.
##a non cooridnate checking squares completion method for instance might use a neighbor intersection
##test relative to two cosequently chosen faces, but we have to ensure that we are picking 
##the right desired square for user desired tiling.  Would likely need to include a coordinate 
##sequencing method where iterating through the data set by neighbor vertex.
##alternately perhaps applying creating an integer key sequence map between selected faces, 
##presuming that all faces are ordered in obj.data.polygons set
# retrieve the active object
bpy.ops.object.mode_set(mode = 'OBJECT')
obj = bpy.context.active_object
faces = obj.data.polygons
selectedfaces = []
vertstofaces = {}
facetofaces = {}
operatefaces = 2
##get selected faces
i = 0
facetoindex = {}
for face in faces:
   if face.select:
      selectedfaces.append(face)
      facetoindex[i] = face
   i += 1
##get facetofaces (neighboring faces for each selected face)
for face in selectedfaces:
   verts = face.vertices
   vfacesmatch = []
   vfacesmatchcheck = False
   for vert in verts:
      if vert in vertstofaces:
         for vface in vertstofaces[vert]:
            if vface in vfacesmatch:
                vfacesmatchcheck = True
                if face in facetofaces:
                   facetofaces[face.index].append(vface)
                else:
                   facetofaces[face.index] = [vface]
                if vface in facetofaces:
                    facetofaces[vface].append(face.index)
                else:
                    facetofaces[vface] = [face.index]
            else:  
               vfacesmatch.append(vface)
         vertstofaces[vert].append(face.index)
      else:
         vertstofaces[vert] = [face.index]
##finish bimap completions
for face in facetofaces:
   for nface in facetofaces[face]:
      checkr = False
      for nrface in facetofaces[nface]:
         if nrface == face:
            checkr = True
      if not checkr:
         facetofaces[nface].append(face)
## process selected faces
finishedprocessing = []
print(facetofaces)
print(selectedfaces)
print(vertstofaces)
facetofacesk = list(facetofaces.keys())
facetofacesk.reverse()
## find end point face on a row
i = 0
for face in facetofacesk:
   if len(facetofaces[face])==1:
      a = facetofacesk[0]
      facetofacesk[0] = face
      facetofacesk[i] = a
      break
   i += 1
for face in facetofacesk:
   ##orderedfacelist = [facetofacesk[0]]
   if ((not face in orderedfacelist) and len(facetofaces[face])==1):
      orderedfacelist.append(face)
      pick = facetofaces[face][0]
      i = 0
      while ((pick not in orderedfacelist) and i <100):
         orderedfacelist.append(pick)
         for face in facetofaces[pick]:
            if face in orderedfacelist:
               continue
            else:
               pick = face
         i+=1
print(orderedfacelist)
##process
for face in orderedfacelist:
   processselect = []
   i = 1
   print(finishedprocessing)
   if face in finishedprocessing:
      continue
   nextface = face
   processselect.append(nextface)
   while i < operatefaces:
      for neighbor in facetofaces[nextface]:
         if ((neighbor in finishedprocessing) or (neighbor in processselect)):
            continue
         else:
            processselect.append(neighbor)
            nextface = neighbor
      i += 1
   bpy.ops.object.mode_set(mode = 'EDIT')
   bpy.ops.mesh.select_all(action = 'DESELECT')
   # reselect the originally selected face
   bpy.ops.object.mode_set(mode = 'OBJECT')
   print(processselect)
   for face in processselect:
      obj.data.polygons[face].select = True
   bpy.ops.object.mode_set(mode = 'EDIT')
   bpy.ops.mesh.inset(use_boundary=True, use_even_offset=True, use_relative_offset=False,
                      use_edge_rail=False, thickness=0.1, depth=0.0, use_outset=False,
                      use_select_inset=False, use_individual=False, use_interpolate=True)

   obj.data.update()
   for face in processselect:
       finishedprocessing.append(face)
       
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.select_all(action = 'DESELECT')
   # reselect the originally selected face
bpy.ops.object.mode_set(mode = 'OBJECT')
for face in orderedfacelist:
   obj.data.polygons[face].select = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.extrude_faces_move(
    MESH_OT_extrude_faces_indiv={"mirror":True}, 
    TRANSFORM_OT_shrink_fatten={"value":-.01,
    "mirror":False,
    "proportional":'DISABLED',
    "proportional_edit_falloff":'SMOOTH',
    "proportional_size":1,
    "snap":False,
    "snap_target":'CLOSEST',
    "snap_point":(0, 0, 0),
    "snap_align":False,
    "snap_normal":(0, 0, 0),
    "release_confirm":False})
obj.data.update()



Saturday, March 21, 2015

Google Code to Github migration

My code project has moved to a new site location.
This can be found at https://github.com/christophermoverton/ogre3d-terraineditor

There are some nice sources that I've found by the way online through Google Code for open source code that I've managed to adapt into my own.  I hope others follow suit in transferring their repositories before it is too late.

Wednesday, March 18, 2015

The possibility for some other intelligent civilization having occurred on Earth earlier than we know today?

    Watching a recent documentary on this subject matter actually inspired me, since it seems an excellent logical question to ask, even if much of a history seems to exclude the idea in general, or at least simply put, why hadn't humans or some other indigenous group of hominid on Earth flourished here on this planet as an intelligent species if many necessary factors were in place allowing for such at an earlier time relative to the present day prehistoric evidence for such?  A reading on of world history (both recorded and prehistoric) would posit any number of theories, humans, for instance, were likely then the best candidates even if having at any given time also competed with other groups of intelligent enough hominids for survival.  At this humans appeared on the Earth scene, for instance, some 200,000 years ago.


Examining also Vostok petit data on climate variations in such past would have indicated that an optimum time, for human civilizations to have flourished (with a known viable intelligent civilizations candidate) would likely have been at an optimum some 125,000 years ago, and likely with a rough screwball sort of estimate a window of approximately 10,000 years to flourish, before climate change factored more heavily against the possibility of not only major agricultural centers having flourished, but providing the necessary seed for major world populace having worked technologically around climate change to sustain a given population.  Of course, there appears to be no evidence that humans exactly did flourish in significant numbers to any degree some 100,000 years ago at the last inter glacial maximum, and this would instead mean more waiting time for any potential civilization flourishing, mindful that not merely climate should be a factor here, but that any co evolutionary process would be in place allowing for the emergence of civilizations.  This means an adequate supply of potential grain sources, coupled with seasonal sufficiency and other geography permitting conditions.  How might for instance, the fertile crescent compared some 100,000 years ago relative to the present inter glacial maximum?  Might there have been fewer options, for instance, in cultivatable grasses that would yield a digestible food source, and secondly, any other condition necessary leading to the condition of human populations flourishing.  Obviously it seems mechanized labor would have a biological hybrid counter part found in animal husbandry, it seems the first cows may have originated in modern day Turkey some 10,500 year ago, with little evidence previous of any domestication of life stock prior.
    Then it seems any potential candidate for domestication, potentially may have been dispersed in some way, or neither given to the right evolutionary conditions for domestication some hundred thousand years ago potentially one might suspect, and secondly, that any domesticated livestock candidate itself might have been responsible for the co evolutionary development of grains that would be suitable for human consumption.  We know, for instance, that mammals have played an important role (not just humans alone) in the evolutionary development of the common fruiting trees, and grains likely found in agricultural production and consumption use found today.  For instance, where mammals are found in less significant numbers yields often a geography that is less suitable for mammalian habitation.  This isn't to say that the necessary factors then having occurred some hundred and twenty five thousand years ago weren't in place to aid in the development of some advanced civilization but the statistical odds may have been stacked against such development.  Thus, for instance, there might have been some agricultural development, maybe growth of small (relative to today) agricultural centers having flourished, but there may not have been a significant enough spark as it appears relative to today for any civilization to emerge and flourish in a more long lasting sense that would lead to population numbers that we see today.  Adding to this then, that we might have had additionally other competition struggles that wouldn't predominantly exist in the same ways (say another intelligent hominid, for instance, like the Neanderthal) that human populations would have been competing against for resource use.  This is also not factoring any social developments that might have taken place which aided further in the proliferation of human civilizations that we see today given through some hardening process given from a glacial minimum in so far as climate were concerned.  Of course, it seems also logical to say that human civilizations would also have had at the height of an ice age, the ability to flourish any civilization period, given that climate would likely have factored so heavily against, agricultural production, and that conditions in general were more often too harsh in the allowance of any major world wide development.  May be small population centers here and there, but often, perhaps, given by too remote for ease in inter communication, or anything would aid in the proliferation of trade and/or spreading such civilization out of a given geographic heart center.  I would be biased, as I have alluded to earlier in reasoning, that if any civilization were to emerge, it would likely emerge where the best chance could be given for things to take off.  Obviously, the modern day Fertile Crescent would likely be a good starting point...good books have been written on theorizing why this is the case.


The above map is a human migrations map.  It seems some 70 to 60 thousand years ago, for instance, when humans might have migrated out of Africa, climate change had already occurred, and likely would not have represented an optimum for the growth of an intelligent civilization.  Prior to this time frame, humans had yet to climb out of Africa, and potentially having climbed out of Africa, may have come in some transition spurt potentially.  Excepting, for instance, Native American rapid latitude advances some twenty thousand plus years ago, it would seem longitudinal advances pass more rapidly relative to one's given by latitude in so far as agricultural development?  Why might this be the case?  One because as it turns out a given plant food source would be more highly sensitized to latitude relative longitudinal changes.  If anything of civilization's growth were at stake here, latitudinal adaptations in the technological advance of plant food source seed stock would be slower in coming relative to those societies implementing hunting predation models.  Thus why Native American's would have likely had the best population success in hunting and gathering relative to adapting grains when moving from north to south.  The American bison could have been a potential candidate for livestock, but it seems also that inhibiting factors might include the fact that the behavior of the bison can be unpredictable and less likely stable in so far as a human animal inter social relation, and then the American Bison as a Eurasia relative came some two hundred thousand years ago across the Bering land bridge.  Unfortunately, it would appear the America's it would appear hadn't had an important herbivore that would aid in the co evolution of grasses, that potentially could be made use in so far as agriculture.  Maize in central America coupled too a less populace variety of candidates would pale relative to the options found, for instance, in the fertile crescent.  Thus it seems the importance in some roaming, grazing, and herding mammalian herbivore would likely have run hand in hand with the chance success, I would argue, for any intelligent human civilization, and likely the longer such herbivore has been around to graze, perhaps, the better success chance that any number of diverse grain crops would have chance in successfully evolving that could be made to some agricultural use by humans.  This is not only to say that in order likely for an intelligent civilization to arise, relies on the necessary condition that a species is intelligent enough, but all other factors of evolution work hand in hand to supply the necessary ingredients here...namely, that any civilization likely inter relates in a symbiotic way to much other biology providing aid in forming such civilization.  Livestock likely aided (prior to domestication) in the systematic development of grains that could be potentially consumed directly, as opposed to human's being reliant upon (in so far as predation models) the livestock direct as a consumed food energy source.  Without a given live stock (or some herbivore) to feed on such grasses, arguably there would be less in nature aiding in the evolution of grasses that could directly feed or supplement diets in the nutritional sense, and likely the process of having developed such grain without some intermediary biology (such as herbivore), it would be likely less possible that human's alone might have adapted a grass into a cereal crop.  Thus, if one hundred thousand years ago, humans happenstance settled into the fertile crescent region, they likely would not have had a latitudinal seed bank to rely, in adapting to such regional conditions, or if they had, the seed/grain adaptation process likely would be slower in coming relative to a longitudinal migration implementation.  Why Euro colonists, for instance, would have not only had much greater technological vantage, but also had longitudinal favorability in their advance across the Atlantic.  If they were forced more North and South, in terms of migration, they would have likely had a slower time/progress in settling and adapting grains to a given geography, and thus why, for instance, euro colonization at times has favored self similar geographic latitude ranges in terms of agricultural production.  Early human ancestor migrants, as we might suspect, may have been more hunter and gathering types, but even if they had the ability to cultivate some grains, adoption to cultivate in this manner, may have been supplementary in nature, as opposed to predominant.  While I have seen physicist suggest that bio mechanically meat is the great source of human intelligence, it is not the favorable choice of intelligent civilizations having emerged.  Why so?  As it turns out the production to energy harvest expense is often greater when an intermediary biology is necessary for consumption.  Thus, for instance, it typically cost more for to produce ounce for ounce for the same caloric energy, a pound of meat relative to the same amount of energy in grain.  As it turns out, this added energy cost, is often given by the expense of raising both the grain/grasses, and the live stock together as opposed to direct to consumption models of grain alone.  Likely then I would posit statistically the best chance for an intelligent biology not only comes from the ability of its adaptation to found sources, but that it may be rarer for instance, finding intelligent civilizations that exclusively feed from heterotrophs alone and neither has some independent direct to consumption model for autotroph food energy source.  Secondly, consuming plant sources (autotrophs) for energy gains through organized social cultivation, would mean that human civilization were better slated to withstand seasonal variations in food sources, found either in traditional hunter gather and/or smaller subsistence based farming models.  This would mean humans could dispense with and evolve, sexual cycles that were no longer seasonal in nature, and to say the least a greater expanse in many respects of human intelligence could be utilized.  For instance, humans could then expend more energy on thought abstraction as opposed to relating everyday experience and inquiry through survival necessities more often than not. 

     If it were true that some intelligent civilization had emerged and humans were likely it in so far as such biology responsible for flourishing.  It would seem if populations were abundant then as they are today.  Likely we might have as in the claim of proof, evidence or indicators of such.  Likely in such civilization, one should imagine, technologies and materials being created that should arguably with stand all the elements of time, that something could be more oxidation or corrosion resistant, for instance, might be a tell tale sign that a civilization once highly advanced had existed.  Even if it were some hundred thousand years, and happenstance, human ingenuity as the spark of major fireworks managed to kindle together a massive global civilization.  It appears statistically speaking we managed to do this on time scales ranging in the tens of thousands of years, and climate cycles could at least provide some window.  On the other hand, if such were the case, nothing of clear evidence has emerged at all, and likely then it seems much more far fetched, given that humans had to advance themselves well throughout the globe firstly which might have been a greater pre occupation relative to settlements and/or all the process hurdles of technological adoptions and adaptations that would be necessary relative to what might also have been a presumably slow advance out of Africa.  Now consider the advance of Native Americans throughout the America's in a mere wink of twenty thousand years which covered far more latitudinal turf than our early ancestors well over a hundred thousand years ago, and one might sense that technology even then for the hunter gathering just weren't even the same relative to more modern hunter gatherers.  It seems more likely in mind, that our ancestors of a hundred thousand years before likely hadn't the same bank of knowledge to rely upon in so far as technological adaptation and adoption that could likely have been important precursors for technological advancement and the creation of agrarian civilizations which in turn produce the types of advanced civilizations that we see today.  The slow northward advance of human's migration out of Africa seem to fit in line in another way with human societies potentially here, if it were that conditions were either too harsh or too easy, social communication and travel would appear geographically more limited, more often than not, this legacy still persists to this day in certain sub tropical if not tropical regions of the world.  However, it seems something of the more ancient ancestor may have had something of a fastidious and geographically fixed mindset (relatively so) to the more modern invading colonist.  While intelligence may have been there, change and technological adoption and adaptation necessities were likely differed potentially in so far as cultures.  Furthermore populations being limited and less likely dispersed should necessarily limit growth expansion.  It is one thing to walk into another world that is more extreme relative to one's own, and have to learn how to live all over again.  Whereas the north to south advance of a hardened and likely well knowledge banked culture of another peoples, could mean much greater advantage in such migration as in the Native American migrations case, especially where essentially migration is rooted in such culture by stronger demands of necessity.  Today's civilization is very marked in a strongly global way.  At least it is un mistakable that if our civilization ever did perish, there could likely be found evidence throughout the world of such civilization having existed, and that much of the technology and sciences attributed to the systematic development of infrastructure were neither owing to a stricter geographic locality in so far as technological achievement, and while there, for instance, are indicators and evidence for more broad and widespread communication of ideas, art, and knowledge in a given region, one could not also mistakenly notice that at times regional locality and restriction that disseminated knowledge might have flowed in travelling from one region to another.  Thus the world for classical antiquity might have seemed to be restricted to a region around the Mediterranean at times, even if had included parts of Asia Minor and beyond this.  Obviously, it would seem that statistically one were harder pressed to find that technological achievements of an isolated output or agricultural center while significant for its time should have some major comparison with the achievements of today.  That is, likely to produce, for instance, the body of expertise, both in terms of metallurgy, for instance, geology, chemistry, and any number of involved sciences that would lead to some like kind exotic materials production.  Is likely owing to some civilization that should have some broader population expanse.  At least this is another bias that one might have in terms of a civilization's achievement potential, and if something alien were to produce much the same, likely that this disseminated knowledge were the collective efforts of a greater populace of individuals in an intelligent society that provided significant valuation in such developments, and weren't merely happenstance the accidental achievements of a handful of extraordinary geniuses alone, and also given by the power of civilization to divest into diverse economic systems that lead to a greater array of occupational trades.  Considering that while our civilization harnesses in a broadly global sense the energy systems of our own planet, if ever the resources, for instance, of this civilization were able to harness the power and energy likely of a given solar system, one might, for instance, expect a population of expanse in reflection to the achievement potential of such as a rule.  Thus, such civilization might be able to travel more readily freely, and inexpensively to any local neighbor in the solar system, as opposed to present day travel models which suggest quite cumbersome economic costs relative to the size and scale of a present day civilization, for instance.  

I have heard at times theories about migrants from say, for instance, regions of the Mediterranean all the way to North America, even so predating Viking chronicles, and while if these accounts were nothing more than myth or at worst some manner of hoax, on the other hand, one might likely refrain in the belief that anglo civilization would have had reason to thrive and flourish if it had come at some time frame earlier than that given either by the Vikings or by European colonists.  One at least given the range and scope of an economy, not withstanding the differences of sea man ship that could be accounted for in a given Atlantic passage crossing.  It seems if ever any from classical antiquity might have arrived, the economy from which such voyagers had come could be much differed relative to later coming European colonist, and likely for all the many voyages and expeditions that were granted by then, were given likely by the numbers increasing odds for survival.  Early colonist's did have extremely difficult times, for instance, even when supplies should be given to some frequency.  On the other hand, if the Roman's had yet to completely consolidate Europe (into the British Isles), or at that the northern now German frontier were anything of another world at the apex of an ancient civilization past, its hard to imagine ancient Egypt or Mesopotamia, heavily investing itself so much further when frontiers were its doorsteps all around, and at times, if the stability of a given system were not as likely in as much through the perpetuation of wars or anything other that were costly to such civilization which likely should drain resources away from exploration alone.  It seems less likely also to proclaim something more of what seems mysterious to us, if only ignorance should exist in so far as the deductive reasoning and evidence of the likely power that any past civilization might have harnessed, and here then I imagine only the possibility that nothing more than a small fleet of ships possibly might have by some remote chance landed on American shores, but likely could have been well less at sea owing to some navigational mistake which landed a fleet for all one should know in the Sargasso sea.  If ever such crew might never have returned home from any American soil that it landed upon, after all nothing of documentation exists suggesting such account for all we know, and then one lone Irish monk that managed a crossing from one end to the other, did so on much rarer accounts.  Hardly a hand few of individuals, despite any romantic inclination, having survived with much chance alone, other than having been overwhelmed by indigenous populations likely.  At this one imagines, death or assimilation, but certainly not having brought the pyramids of Giza to the central America's.  More so, syncretism, is merely happenstance to the notion that mounds pyramids alike resemble ideal geometries of a intelligent like minded humans that emerged from the thick of the ice, and had with this in mind all the similarity in fashioning similar social hierarchy, and at this resorting in a similar fit, monument building as an expression of social, religious, political, and economic ideals.  Civilizations such as these come flourish, wane and find re expression.  As architectural engineering changes accordingly and diversifies, it seems the era of megalith and extreme monument building also changes, but this emerges as civilizations themselves have only proliferated greater knowledge and that expression in form has changed relative the past.   In as much that civilizations past, may have preoccupied themselves by scale and divested its resources to much greater extent expressing with purpose the symbolism of power found by scale.  The tenure of an intelligent civilization may have found the diversity of its cultures having urged restraint, sobriety.  Emperors, kings, and pharaohs could less argue over time, that they hadn't squandered the resources of an empire when they had done so on some ruthless war that might have left the power of any legacy in question.  The gods themselves might have been questioned if not given by fractious social division between war gods and those of peace.  While others could be declared heretics and have their name defaced from walls.  Thus architectural scale itself might have been left in some meaningless void to some owing to the rise of a more cynical populace of people in well tenured civilization that were given to much freer reign of thought than ever before.  Imagining that some other intelligent human or hominid might have arisen before, if this were ever possible, on the other hand, one sees potentially a similar chord of history having arisen in the imaginations of such intelligence.  Having gone through some similar maturing process which would lead to some similar synthesis in thinking and development...maybe some much more rapid than others, but a lot given to the statistical hardships of time, and that progress is not linear.  Anything of social evolution could rapidly devolve for any number of reasons.    

  What have I not covered so far in terms ideas in terms of the future of, for instance, Earth in so far as human civilization?  In speaking, for instance, of human civilization's present relative to a given past, it seems not only that one may speak of a world that is even more globalized in terms of communication, and language in general, the evidence of this is given by decline in the diversities of languages in general, but also that language that once may have been more limited in terms of its reach in written form (by way of complexities), has been met by the synthesis of a broader reach into a given larger population set.  I argue that this synthesis could be described in ways lending to uniformity neither having existed so much prior when, for instance, the scope of trade broadens and makes for greater demands in reaching a broader populace.  Thus ancient scripts, for instance, may have transformed into easier written character type forms, or to say the least, no longer a reed and stylus found in the common practice of such writing in so far as adapting, for instance, fewer character variations, and that this would in turn lead to accessibility provided by new writing medias.  The hallmark of progressing civilizations might be, for instance, described by evolution of written languages which in turn are given to furthered character sets relative to a given language ancestor (ironically) although I am not certain this is always the case.  If anything of human intelligence ranges in the power of the social evolution of language, this could be owing to the range and scope of human memory which according to more broad population sets accord ease in aids to memory and the usage of such written language.   In re echoing previous ideas, the transformation of culture might also be described by the power and change provided by education and literacy as a civilization has advanced.  If in some ways, technological advancement could be hallmarked by the nature of homogenizing aspects of communication in a given world.  On the other hand, it seems also that another diversity itself has arisen, as suggested earlier, leading to the changes and transformations given to a civilization of people in so far as social inter relations are concerned, how such people see themselves in relation to their governments as one might theorize influencing the degree by which governments initiate in varying ways, for instance, anything of investment into infrastructure, and how people in such civilization might be led.  For instance, why is it harder for modern civilizations, to embrace their leaders in ways that might have been found more commonly in the ancient world?  Why, for instance, had the role of leadership declined in so far as the practice of commonly linking such to a Earthly spiritual realm?  In part I have, as others, have suggested a reason for this, and in another way, one might possibly find greater links to the power of science, education, and reason similarly transforming a given culture, no less that reason and passed wisdom from one generation to the next, leads to a change in thinking when it is understood that something of recorded history echoes into a then present.  Not that the progress of civilization is always met by anything linear always in nature or growth even in the natural sense by way of exponential foundations but that seemingly at times regression has also occurred.  New resentments of old cultural foundations, for instance, may lead to new iconoclasm, and with it at times the ransacking and parting of old knowledge which later have been rekindled through periods of enlightenment and renaissance.  I would theorize in like kind that there are likely other worlds having experienced potentially a similarity in some manner in terms of its own history.   As to a given future world, our own civilization may find itself in the perils of self existence and annihilation, as likely continued proliferation of ideas make potentially abundant designs for both progress and self destruction.  Even more so with population growth, comes the perils to our own modern concepts of individuality and freedom but also providing even greater opportunity one might expect.  The perils it would seem may be something of increasing demand for conformity and cultural uniformity, while on the other hand, in the model of freedom, increases in education more broadly impacting a given populace is met by only increased diversity with respect to the spheres of occupation to be had.  It seems the coexistence between the noise of democracy and an erosion of this seem to be ever so at times in a given struggle.  In this day and age, for instance, if world governments haven't similarly embraced the notions of democracy, on the other hand, finding much reason of suspicion in it.  I leave open the question of what remains here to be seen, although certainly I hope that achievements of progress here are met only in furthered advance of democracy.  Submitting to a bias here, marking to a cornerstone to the concept of 'democracy', when our civilization is willing to embrace different ideas, we maybe more willing to critically reason through our own sets of notions.  The more self similar we are in relation to other, also risks the ability of civilizations to change or progress.

Much of opinion here is in reference to "Guns, Germs, and Steel" by Jared Diamond, Carl Sagan, and others.

Wednesday, March 11, 2015

Passing scaled coordinate data to noise with tiling algorithm

So for the formula,

Ftileable(x, y) = ( F(x, y) * (w - x) * (h - y) + F(x - w, y) * (x) * (h - y) + F(x - w, y - h) * (x) * (y) +
       F(x, y - h) * (w - x) * (y)) / (wh)

It is important when scaling coordinate data ensuring the proper w,h values are provided.

Thus if having chosen based upon iterated integer coordinate values i,j

double x = ((double)i) / scale;
double y = ((double)j) / scale;

Ftileable formulation necessarily changes.  One because one need ensure that one chooses on a given noise coordinate position positions in the neighboring (theoretical) tile.  Thus passing the coordinate
double xp = x-512;

is not right since coordinate values are being in this incremented by 1/513 float values to the noise function, and the coordinate xp is well outside the prescribed neighboring region for the given formulation.

Instead,

double xp = x - 512.0f/scale;
and correspondingly
double yp = y - 512.0f/scale;

Also weighting factors need be adjusted accordingly.  Otherwise, noise values are weighted improperly.

double ws = w/scale for w

and

double hs =  h/scale for h.

also the factor
wh
changes to

wh/(scale*scale)

so the formula with scaling changes to

Ftileable(x, y) = ( F(x, y) * (ws - x) * (hs - y) + F(x - ws, y) * (x) * (hs- y) + F(x - ws, y - hs) * (x) * (y) +
       F(x, y - h) * (w - x) * (y)) /( (wh)/(scale*scale))

  

Seamless tiling on fixed height map


I managed to find this bit of code for seamlessly tiling using a noise algorithm.
Ftileable(x, y) = (
       F(x, y) * (w - x) * (h - y) +
       F(x - w, y) * (x) * (h - y) +
       F(x - w, y - h) * (x) * (y) +
       F(x, y - h) * (w - x) * (y)
) / (wh)
or basically a correlated statistical weighting with coordinates.  In the algorithm, one need supply coordinates to a choice noise algorithm.  

In this case I were looking for a slight modification say when using textures with corresponding heightmaps either having more data intense procedural computations or neither having coupled noising procedure.  

In this case one would need to replicate some manner of periodicity of the texture heightmap tile at the given edge boundary.  

For instance on a height map with localized  u v coordinates with 513x513 positions.  
The position (0,0) would need be matched to a texture tile at position (512,0) as a left neighbor, position (0,512) for a given bottom tile neighbor, and (512,512) for the bottom left neighbor tile.  

Or in generalized coordinates (-512,-512), (-512,0), (0,-512) would need be matched.  

To produce periodicity of the texture then one could use simple flip algorithms on the tile so that the noise were periodically matched.  

In this case, 

180 rotation is top bottom flip with lr flip. (x,-y)
left right flip is (-x,y)
applying lrflip to tpbtm coord -xtb, ytb is tblr flip or pure 180 rotation is lrtb flip (-x,-y)
F(x-w,y) uses lr flip, F(x,y-h) uses tb flip, F(x-w,y-h) uses lrtb flip 

An excerpt of my code would then look as follows when iterating over the set of height map points:
   terr::Coordpair hcoord = (*i).first;
   int xpos = hcoord.first;  int ypos = hcoord.second;
   int xposp = xpos-512;  int yposp = ypos - 512;

   terr::Coordpair * hcoord1 = new terr::Coordpair(-1*xposp, ypos);
   terr::Coordpair * hcoord2 = new terr::Coordpair(xpos, -1*yposp);
   terr::Coordpair * hcoord3 = new terr::Coordpair(-1*xposp, -1*yposp);
   double val1 = (*combinevals)[hcoord]*((double)(512-xpos))*((double)(512-ypos));
   double val2 = (*combinevals)[(*hcoord1)]*((double)(xpos))*((double)(512-ypos));
   double val3 = (*combinevals)[(*hcoord2)]*((double)xpos)*((double)ypos);
   double val4 = (*combinevals)[(*hcoord3)]*((double)(512-xpos))*((double)ypos);
   double height = (val1+val2+val3+val4)/(512.0f*512.0f); 





Example result shown above.

Another potential simple method also uses flips on a given map combining all maps into say a 1026 x 1026 map and then re sizing the height map down to 513 x 513 (or a maps original size).  This, however, I imagine includes resolution loss in height data.

Either of these methods tend to produce very symmetric looking noise maps.

Saturday, March 7, 2015

Terrain Height map resampling with BiCubic filtering

See the previous post for the TerrainStruct.h header file.  Somewhat redundant post but setup to compile on my linux compiler with the given gnu version that I am evidently using which for some odd reason is fussy around passing by values arrays (or something funny like this).
//*****************************BiCubicResample.cpp****************************************
#define __BicubicResample_CPP
#include <vector>
/*
double cubicInterpolate (std::vector<double> * p, double x) {
 return (*p)[1] + 0.5 * x*((*p)[2] - (*p)[0] + x*(2.0*(*p)[0] - 5.0*(*p)[1] + 4.0*(*p)[2] - (*p)[3] + x*(3.0*((*p)[1] - (*p)[2]) + (*p)[3] - (*p)[0])));
}
*/
///*
double cubicInterpolate (std::vector<double> * p, double x) {
 return (*p)[1] + .5f*x*(-1.0f*(*p)[0]+(*p)[2]) + x*x*((*p)[0] - 5.0f/2.0f * (*p)[1] +2.0f*(*p)[2] -.5f*(*p)[3]) + x*x*x*(-.5f*(*p)[0] + 1.5f*(*p)[1] - 1.5f*(*p)[2] +.5f*(*p)[3]);
}
//*/

//trying a forward differencing as opposed to central difference method. Same deal.
//
/*
double cubicInterpolate (std::vector<double> * p, double x) {
 return (*p)[1] + x*(-1.0f*(*p)[0]+(*p)[1]) + x*x*(2.0f*(*p)[0] - 5.0f * (*p)[1] +4.0f*(*p)[2] -1.0f*(*p)[3]) + x*x*x*(-1.0f*(*p)[0] + 3.0f*(*p)[1] - 3.0f*(*p)[2] +1.0f*(*p)[3]);
}
*/
double bicubicInterpolate (std::vector<std::vector<double> > * p, double x, double y) {
 std::vector<double>  arr(4,0);
 for (int i = 0; i < 4; i ++){
    std::vector<double> v(4,0);
    v[0] = (*p)[i][0]; v[1] = (*p)[i][1]; v[2] = (*p)[i][2]; v[3] = (*p)[i][3];
    /*
    arr[0] = cubicInterpolate(&((*p)[0]), y);
    arr[1] = cubicInterpolate(&((*p)[1]), y);
    arr[2] = cubicInterpolate(&((*p)[2]), y);
    arr[3] = cubicInterpolate(&((*p)[3]), y);
    */
    arr[i] = cubicInterpolate(&v,y);
 }
 return cubicInterpolate(&arr, x);
}
#endif 

//**************************BuildBiCubicResample.cpp*****************************************
#ifndef __BuildBicubicResample_CPP
#define __BuildBicubicResample_CPP
#include "TerrainStruct.h"
#include "BicubicResample.cpp"
#include <vector>

terr::CPointsMap * BuildBicubicResampl( double size, double RSize, terr::CPointsMap * heightmap){
 terr::CPointsMap * Rheightmap = new terr::CPointsMap();
  
 for (int i = 0; i < RSize; i++){
  for(int j = 0; j < RSize; j++){
   
   double x = ((double) i) * (size-2.0f)/(RSize-1.0f);
   double y = ((double) j) * (size-2.0f)/(RSize-1.0f); 
   
   int p1x = (int)x; int p1y = (int)y;
   double locx = x -p1x; double locy = y-p1y; 
   int p2x = (int)x+1; int p2y = (int)y+1;
   int p0x = (x <= 0 ? p1x : p1x-1); int p0y = (y <= 0 ? p1y : p1y-1);
   int p3x = (x >= (size-2.0f) ? p2x : p2x+1); int p3y = (y >= (size-2.0f) ? p2y : p2y+1); 
   terr::Coordpair * p00 = new terr::Coordpair(p0x,p0y);
   terr::Coordpair * p01 = new terr::Coordpair(p0x,p1y);
   terr::Coordpair * p02 = new terr::Coordpair(p0x,p2y);
   terr::Coordpair * p03 = new terr::Coordpair(p0x,p3y);
   terr::Coordpair * p10 = new terr::Coordpair(p1x,p0y);
   terr::Coordpair * p11 = new terr::Coordpair(p1x,p1y);
   terr::Coordpair * p12 = new terr::Coordpair(p1x,p2y);
   terr::Coordpair * p13 = new terr::Coordpair(p1x,p3y);
   terr::Coordpair * p20 = new terr::Coordpair(p2x,p0y);
   terr::Coordpair * p21 = new terr::Coordpair(p2x,p1y);
   terr::Coordpair * p22 = new terr::Coordpair(p2x,p2y);
   terr::Coordpair * p23 = new terr::Coordpair(p2x,p3y);
   terr::Coordpair * p30 = new terr::Coordpair(p3x,p0y);
   terr::Coordpair * p31 = new terr::Coordpair(p3x,p1y);
   terr::Coordpair * p32 = new terr::Coordpair(p3x,p2y);
   terr::Coordpair * p33 = new terr::Coordpair(p3x,p3y);
   
   std::vector<double> ay(4,0);
   std::vector<std::vector<double> >  a(4,ay);
   a[0][0] = (*heightmap)[(*p00)]; a[0][1] = (*heightmap)[(*p01)]; 
   a[0][2] = (*heightmap)[(*p02)]; a[0][3] = (*heightmap)[(*p03)]; 
   a[1][0] = (*heightmap)[(*p10)]; a[1][1] = (*heightmap)[(*p11)]; 
   a[1][2] = (*heightmap)[(*p12)]; a[1][3] = (*heightmap)[(*p13)];
   a[2][0] = (*heightmap)[(*p20)]; a[2][1] = (*heightmap)[(*p21)]; 
   a[2][2] = (*heightmap)[(*p22)]; a[2][3] = (*heightmap)[(*p23)];
   a[3][0] = (*heightmap)[(*p30)]; a[3][1] = (*heightmap)[(*p31)]; 
   a[3][2] = (*heightmap)[(*p32)]; a[3][3] = (*heightmap)[(*p33)];   
   
   double height = bicubicInterpolate (&a, locx, locy); //slower matrix compute method
   terr::Coordpair * coord = new terr::Coordpair(i,j);
   (*Rheightmap)[(*coord)] = height;
  }
 }
 return Rheightmap;
}
#endif


Terrain Heightmap resampling with Bilinear filters

The idea is similar for Bilinear re sampling as is with bi cubic re sampling, albeit in this case one would be using 4 points instead of 16 sampling points.  The sample points would be [0,0], [0,1], [1,0], and [1,1] in local coordinates.  Also bi linear sampling tends to produce noticeable visible artifacts on the sampling grid edge boundaries (this is the per pixel boundary on the original sample size space), so I've thrown in a quintic smoothing equation (similar to a bi linear smoothing method found and used in other related algorithm work).


//************************TerrainStruct.h**************************************
#ifndef __TerrainStruct_h
#define __TerrainStruct_h

#include "TPoint3.h"
#include <list>
#include <queue>
#include <set>


#include <functional>
#include <vector>
#include <map>
#include <utility>

namespace terr{

 typedef std::pair<int, int>                                  Coordpair;
 //typedef std::tuple< int, int, int>                            T3dCoord      ;
 typedef std::map<Coordpair, double>                           CPointsMap   ;
 typedef std::map<TPoint3 *, double>                             T3dCPointsMap ;
 typedef std::map<TPoint3 , double>                            T3dMap;
 typedef std::map<int, CPointsMap>                             CPointsMaps  ;
 typedef std::map<Coordpair, TPoint3>                          CVectorMaps  ;
 typedef std::map<int, T3dCPointsMap*>                           T3dCPointsMaps;
 typedef std::pair<Coordpair, Coordpair>                       Coordpairs;
 typedef std::map<Coordpairs, double>                          CPairsMap;  //two coordinate pairs to value
 


}


#endif
//*****************************************************************************//

#ifndef __BuildBiLinear_CPP
#define __BuildBiLinear_CPP
#include "TerrainStruct.h"

terr::CPointsMap * BuildBiLinear( double size, double RSize, terr::CPointsMap * heightmap);

double lerp(float a0, float a1, float w) {
     return (1.0 - w)*a0 + w*a1;
}

terr::CPointsMap * BuildBiLinear( double size, double RSize, terr::CPointsMap * heightmap){
 terr::CPointsMap * Rheightmap = new terr::CPointsMap();

 for (int i = 0; i < RSize; i++){
  for(int j = 0; j < RSize; j++){
   //bilinear interpolation is similar to cubic in terms of idea.
   //we interpolate along y (vertical) axis first, and then interpolate on 
   //the horizontal.  We only need to worry about the grid [0,0], [0,1],[1,0],[1,1] 
   //points so computations are smaller.  I've included a quintic smoothing
   //equation to see what happens here...supposed to reduce artifacts.
   double x = ((double) i) * (size-2.0f)/(RSize-1.0f);
   double y = ((double) j) * (size-2.0f)/(RSize-1.0f); 
   ///*   
   //int p0x = ((x == size ? (int)x - 1 : (int)x); int p0y = ((y == size ? (int)y - 1 : (int)y);
   int p1x = (int)x; int p1y = (int)y;
   double sx = x -p1x; double sy = y-p1y;
   int p2x = (int)x+1; int p2y = (int)y+1;
   terr::Coordpair * p11 = new terr::Coordpair(p1x,p1y);
   terr::Coordpair * p12 = new terr::Coordpair(p1x,p2y);
   terr::Coordpair * p21 = new terr::Coordpair(p2x,p1y);
   terr::Coordpair * p22 = new terr::Coordpair(p2x,p2y);
        double u = 6.0f*pow(sx,5) - 15*pow(sx,4)+10*pow(sx,3);
        double v = 6.0f*pow(sy,5) - 15*pow(sy,4)+10*pow(sy,3);
   double h11 = (*heightmap)[(*p11)];
   double h12 = (*heightmap)[(*p12)];
   double h21 = (*heightmap)[(*p21)];
   double h22 = (*heightmap)[(*p22)];
   double iy1 = lerp(h11,h12,v);  
   double iy2 = lerp(h21,h22,v);
   double h = lerp(iy1,iy2,u);
   terr::Coordpair * coord = new terr::Coordpair(i,j);
   (*Rheightmap)[(*coord)] = h;
  }
 }
 return Rheightmap;
}
#endif

Oblivion

 Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...