Friday, July 27, 2012

L'hopitals rule

I almost thought I might have some practical use for l'hopital's rule...hmm
almost key word, almost...the man has really big hare in his portrait.

Spiral staircase problem

So it seems building the spiral staircase and the handrails are fairly straightforward building projects.  Almost at least, how to do it in the graphics related sense?  Well, a basic parametric form is the way I did it.   Here's a simple equation:

f(theta_inc) = (r * cos (theta_inc), r * sin (theta_inc), z_inc * n)

where theta_inc is the incremented position of theta based upon your choice of arc division for the spiral form, n is derived from the function theta_position / theta_inc where theta_position is the sum total of step increments on the arc curvature.

You'd need to compute the vertices for both the inner and outer radius of the spiral stair case which determines corresponding sets of vertices on the lower and upper bounds of the step.

z_inc is a given step division determined by the height of the step divided by incremental arc divisions.

Here one might recall the formula for arc length s = r theta.  Which is a good start for determining the arc increments and the the outer width of the step if you choose to have radial curvature on the step.


For handrails, I started by creating on an arbitrary prime (prior to axis rotations and translations), a polar generated form with width determined by simple polar coordinate expressions similarly defining an arc subdivisions of suitable choice so as to appear sufficiently circular.  Then I rotated coordinates using blender's mathutils Euler rotations ('x', and 'z' on 'xyz')  Remembering that in cylindrical or spherical coordinates similarly, rotations theta are matched to theta on the polar coordinates generation on the prime axis (prior to rotation), and then normal to phi which phi + 90 degrees for the 'x' rotation.  On the polar form generation prior to rotation and translation I left local z prime at 0 providing ease in translation.  Translation is merely done so either at the time of vertex generation or post generation using theta_inc as in the steps case above and making sure to use the outer radius on the steps curvature for position alongside z_inc for height position parametrically speaking.  What results is handrail whose cylindrical height is tangent to the axis of the spiral and whose cross sectional plane is normal to such curvature at any point.














Will probably post code soon here as an example. Generally abstracted so that a user can input dimensions of varying radial, step widths, riser heights and what not.

Stair build blender python file

Programs won't work for generating 'stone' type steps, at least I hadn't debugged and fully implemented this yet.

Sort of tiring at the moment on further work here so I figured I'd post some code on this, just flip to Blender's text view tab, then using the blender text editor, open the python script and run.  Its already set to generate a spiral staircase here.  

Tuesday, July 24, 2012

To the previous post

    Trying to create one of these automated stair mesh generators for utility purposes in blender.  Everything for generating things like Ibeam for the truss supports on industrial steps, to generating stone steps.  May get around to working on spiral steps, and steps having multiple landings and stuff like that...I've tried to incorporate strictness on parameters for things like tread height and width, while providing options for less strict parameters generation of steps (relying more loosely on specified overall dimension values of a given area for stair generation). 

Good problem for the moment it seems for working on basic geometries for coding it seems.

Monday, July 23, 2012

Geometry fun...cylindrical geometry problem...

Literally here.  The problem goes this way.  Looking to find the plane intercept of two intersecting cylinders whose intersection isn't perpendicular.  The intersection in this case is like the case of conics if you are curious, albeit this is a cylindrical elliptic as opposed to generated from in an increasing or decreasing  radial dimension on the surface of the conic where the plane slices at some angle other then 90 or 0 degrees.  In this case, while one might be tempted to resort to something like cylindrical geometry where resources of this sort exist...more commonly you'd likely find spherical trigonometry resources more quickly.  The simplest solution relies upon using projective geometry.  If we project the image of the cylinder in two dimensions where the intercept is to occur, then we can apply at a given angle more familiar trigonometric rules.  The chosen projected image of the ellipse on the local 'yz' in our next example is such that image of local x domain is twice mapped into a resulting right triangle for the given projection
...implying that familiar right triangle trigonometric rules should apply.  Here we choose local coordinate systems such that the chord length a is on local y, and the chord length b is chosen on the local x.  I'd leave it up to you to find the conversion from global to local coordinates here on this problem.  We'd know automatically that chord length b in the cylinder conic is simply the radius of the cylinder...why is this, in the projective since since local z in the projective mapping on the chord length is the same, implies the conversion in the projective sense makes local z irrelevant  for computation of distance ( magnitude) on the local chord length b axis, thus magnitude in preserved from with local x coordinate conversions.  For example,

Where the intersection is projected on the local 'yz' plane the following identity:

tan phi = z / yc  where yc is the unique coordinate system for our given projection and phi is in the intersection angle.

noting that any x, y position on the cylinder whose height (length) axis runs tangent to the z, means that any x or y position is = < radius of the cylinder.  The same is true for any plane intercept for on such cylinder at a given angle theta.  Thus translating coordinate systems to yc, a simple coordinate change yc = radius +/- y depending on the orientation of the intercept.

Here it seems then one can apply the more familiar top down projection on such cylinder to find the coordinates of y at a point, or in other words, polar coordinate system we could compute y as follows.  Or if working in units of arc radians on your given subdivision of the common circle this could look like:

y = cylinder radius * sin theta where theta represent some arc subdivision of 2 pi radians or 360 degrees.

similarly we can find x using:

x = cylinder radius * cos theta

and z is found once having computed y.  This actually generates the elliptical on the intersecting plane likewise.

You could also find the chord lengths a, and find the elliptic equation computing local y which is theta = {0, 90}, which results in a distance magnitude of cylinder radius.  We compute the distance zmag computing from  local z inputting and converting from yc values, then apply the right triangle formula:

a^2 = r^2 + zmag^2

this provides the chord length of a.

hmm...

very informal thoughts no formal proofs here....problem relates to projective geometry.  Say a circle exists on the local xy plane, utilizing the right projection one can project this to a line where choosing a projection such that all but two points, x1 and x2 map have a domain doubly mapped into such projective space to the same coincident points in x' (this means x' = x).  The problem here is that projecting  another circle whom has more then two points neither doubly mapped implies that use of right triangle formulation breaks down, since invariably one circle neither fully aligned to the projective axis will instead by described as an arc on such projective plane, and neither a line?!  I've thought of this alternately, and as it turns out I believe one can still apply the methods above with respect to finding the formulation for the ellipse by way of chord lengths.  Here, choosing the local projective axis such that all but two points x1, and x2 on the ellipse are doubly mapped and are represented as a line of chord length a for the projective plane.  Since in such projective plane where axis are represented by coordinates y' and z' we know that preservation of magnitude should exist in so far as the cylinders local y, this implies that the y' length should be 2 cylinder radius since both such y1 and y2 have no other possible coordinate representation in y' for the respective coordinate companions x1 and x2 .  Which means one can use standard trigonometric formulation here to find the chord length b,

   2a = length(y1, y2) * (sin phi)^-1

I believe similar argument hold for chord length a = cylinder radius with our given intersection...note this is not a skew intersection but where both such cylinder center line (local yz) intersect.

Phi then determines the angle of coordinate conversion and the formula for the ellipse is given by

x ' ^2 / a + y'^2 / b = 1

Then would just need to convert to local x,y,z...here x' = x  and z' = 0.

Reason for this...actually motivated in the applied sense.  Trying to mathematically describe hand rails on stairs :)

Followup:  Put the first mentioned method to test for mesh construction, appears to generate an ellipse or an ellipsoidal curve.

Friday, July 20, 2012

Natural written language software idea

 Inspired on the basis of this particular article...

Proposed list of 60 things journal publishers do
Saw mentions to Latex for publishing, is nice, open source, a bit more convenient as mentioned at site then creating documents then word for higher end scientific publications...granted my personal experience were a couple decades no doubt out of date and at the mere undergraduate level in so far as in slaving over publishable formulation, I spent more time then writing formulas (some several hours) relative to the same time that could have been spent writing them out (likely an hour at best).
Tried latex briefly, I liked it since, there were short hand type methods (e.g. "/Theta" for the Greek letter theta) for writing formulation, sparing a writer some headache in typing formula.

http://www.latex-project.org/

Picked up some Cambridge Super string publication from then Greene and company published entirely in LaTex, nice looking book in any event. 

I would think though the most optimal...if it could ever developed on the open source wish list were a translator that could turn human handwriting into unicode which could then code this for LaTex.  It would probably optimize time spent writing formulation, since a writer would only have to literally write the symbol and neither search for local linguistic translated equivalents with additional symbol tags to be added, or have to scroll through a series of slow and encumbering windows to hunt and peck a given symbol.  Sort of like other commercial software that I've seen floating around these days but able to understand natural written language. 


Thursday, July 12, 2012

Working some on ogre today again.

Some tidbits here had a compiler error popping up namely:

1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

Some unusual aspects about this error here:  Thought to double check the Ogre Visual Studio application wizard's default configuration settings for linking libraries and what not.  Apparently while I get the same error manually setting up Visual studio for building, I can build successfully by disabling Configuration Settings > Linker > General > Incremental Linking > No, but apparently another setting with the Ogre wizards default is still causing a persisting conflict leading to the link error above, or in other words disabling Incremental Linking doesn't resolve this problem with the Ogre Application wizard but works with a manual application configuration of a new WIN32 empty project setup. 

Blender 2.6 to Ogre mesh exporter

Installed this today, managed to import a mesh somewhat here.  Doesn't look so good at the moment, but basic tutorial provides one with working method for importation of mesh and materials into blender. 

Blender work with Sand

Mesh face and vertex count much to high for game mesh and texture here (? possibly) but someday in the future may be found in textures and mesh game renderings.  Alternately it seems if one could create nice well contoured topology around the mesh design, it seems lower face vertex polys could be done without sacrificing resolution quality.

Lately the probably that I've encountered with textures is that tonal imbalances leads to more obvious tiling overlays which become problematic in rendering more with increasing perspective distances with such textures.  Likewise, depth and three dimensional mesh structures can disappear with high tonal variability in such textures.  The more obvious solution is to control this by working with more even tonal textures, and then attempting to mimic variable tonal structures where they would be commonplace and desired in the two dimensional texture rendering.  Thus, for example, if working with sand and attempting to create sand dunes, generally sand grains themselves may not from a perspective distance appear so highly varied, but as aggregated into structures (e.g., sand dunes) one may more likely encounter higher shadow tonal variations.  I found it much easier to create depth in the mesh structure in balance to displacement modifiers and normal maps, rather then color mapping structures like sand dunes.  In this case, I chose a marble effect which is actually a bit irregular and containing distortions providing irregularity in the structures of wind deformation patterns that might be found in sand dunes.  Overall liked the effective look of sand structure, while this neither apparently matches wind based deformation features that I were looking for, namely, where where consistent and prevailing winds would likely shape features in the same ways as opposed to creating patterns of turbulent distortions found below.  Likewise, joins on channels are not found owing to the type of displacement modifier used. 



Tuesday, July 10, 2012

DirectX 9 versus DirectX 10 legacy issues

So having implemented in Blender an data exporter add on which readily converted to a mesh/textures/materials exporter and thinking this might work for DirectX 10, while a promising link here would aid in importing mesh data.  First searched for functions like D3DXLoadMeshFromX (which were a DirectX 9 supported function), but I managed to come up with nothing here, but I did manage to find out that DirectX 10 apparently no longer supports the .X file format for mesh object importation.  Apparently there is a work around, however, that utilizes the much dreaded Autodesk format (dreaded for noob developers or those with less development resources here).  In any event, may look into creating a custom importation class for data, but not really sure.
http://forums.create.msdn.com/forums/p/106138/626005.aspx 

Saturday, July 7, 2012

C++ DirectX, OpenGl, OpenCl, and so forth noob crash course

   So I thought a primer on OpenGl in C/C++  would be easy based upon tutorials.  Turns out not so easy or nice.  At least some examples written in older framework/binding stuff (e.g., glaux, glut, and others).  While openGl, or Gl and Glu headers provided natively here.  Unfortunately examples might be outdated relative to present stuff furnished by Microsoft.  Then trying to learn how to link libraries and what not.  I have to say C++  std::map containers look more pythonic then ever in terms of implementation which is nice.  Easy to remember, compact coding, noticed older implementations in a way old C++ book of mine has a much long winded speak to do the same thing I believe.  I was tempted here to go to Boost libraries for C++ for embedding code.  Because I love the python dictionary so much was looking to alternately try to create a custom dictionary class, one by overloading key and value typeobjects here (way un pythonic but is the work around to C++ rigid type fixations), and then coverting all data with multi map associations between key to key type values, similarly for value to value type pairs, and then cast converting data all to one type, which provides ostensibly one data type container virtually housing like a dictionary  multi type data, just have to re cast convert data back to its original form and overload returns on get functions so that the appropriate return type can be furnished.   The other way of handling this, seems to set up mulit type map containers and tracking in the deeper dimensional case scale of data in its given dimensional position.  Mostly my consideration of the equivalent dictionary written to C++ were a shallow form, however, and likely since I'm a enough a noob, neither allowing self nesting, until I could figure out something like a string cast conversion of such self (this) class.  Dictionaries in python are sort of the nice database utility like all in one (data type) container which I really love a lot...hmm, or then its just retraining one's thinking with respect to data handling which might not be so hard in C++ using the map container.  Also the other thing, that I might miss are the python list.  Of course, map and vectors in the standard library seem to be a closer equivalent to pythons list, since you hadn't need alloc() or malloc() to assign dynamic memory as in the case of an array whose size is yet to be formally determined?!  If you know your data's scaling in C++ already, arrays are easy and not much of a problem, but then it seems (in my rudimentary understanding) if you were say making sql calls to a given database with dynamically assigned memory, then you might easily run into problems with storage for a given return container.  Ideally I imagine an interface in C++ already has something like a multi map container setup, and at least in SQL work you could know ahead of time the type assignments for multi map in so far as data container storage.  Secondly with the multi map, the container's size could be dynamically assigned in so far as data storage (which is generally the case I believe with most python containers).

Finally figured out the purpose of the pointer here which always boggled my mind in the past.  One offered here that pointing to memory avoids having to recopy say object data sent, for example, to a function or inside a class and what not.  And when specific data were needed instead when the pointing object call needs reference values in memory, it could do so on an as needed basis.  Its seems logical and efficient enough in terms of memory usage.  If you were working with heavy data intensive projects, and you were worried about memory usage, seems important.  Nowadays though if you were working with small scaled projects, not heavy in data usage, pointers might seem a bit unnecessary in terms of computational efficiency, it seems there's more memory to go around these days then ever, and then generally it seems supposedly python is supposed to be fairly good at cleaning up on no longer used memory.  Pointers are generally absent in python lexicon.

As to working with Visual Studio which I haven't done in a long time, and when I did last, it were very very brief, so it should seem enough of a learning curve.  Python offers also natively a command line console, I haven't yet figured out a similar tool implementation in C++, although you can run scripts from console with C++ once compiled and built, not sure how to do the compilation and building from console. 

In any event, spent the better half of the day, trying to install or work with any number of stuff, like DirectX sdks, here despite my hardware not being an Nvidia based system (more so Intel graphics architecture), I were able to install Nvidia's SDK and run some examples.  OpenGl weren't so good in terms of getting working either by tutorial examples seen here, either attempting code examples with 2010 C++ libraries, or 2012 C++ libraries, or even working with supposedly appropriately linked libraries(?) packaged project files, not sure if this were because the project file examples were old enough and outdated relative to present libraries, or probably that I don't know what I am doing here so much.  :)  OpenCl were yet another fail install, having thought followed all but one pre requisite here, namely the Windows 3.1 installer fails to install.  While windows does have a patch (64 bit upgrade) coupled with the redistributable binary installer (32 bit), it seems the installer's installation was a no go, and Intel's package fails on the assertion of a missing .dll, presuming this could be owing to the missing installer version here but I am not so certain.  MSDN provides it seems tutorial information for getting started in development, included integrations for application development, there's even in the 2012 Visual studio idea, an object mesh handler for handling 3d objects, would alternately recommend Blender for in depth work and complex mesh object work here.  Hmm, anything else, not that I could think of...despite the supposed benefits of OpenGl here, I'd offer unless it can be a chore getting up and running even with supposedly easy tutorials guiding either implementation and installation.  OpenGl site itself sort of helps, but then I've been disappointed with the results.  Sure game engines like Ogre can possibly run on Linux, but the OpenGL interfaces don't properly render at times object...not sure if this were occurring because of the OpenGl packaging.  Sadly I wanted to say you might have better luck diving into WebGl before you were working decently with OpenGl from my experience if you were really new to programming there.  Hopefully in Linux OpenGl will improve more so, and hopefully in Windows...well hopefully I'll figure out some basics here.

Ending the ramble...  

Groundwater data from USGS Longitudinal data searches are not so good

'corp of engineers hydrological data missouri river'  Google search string...yields top ten entries any number of Congressional bills for one thing or other.

Then a USGS search for ground water data is pretty limited in the longitudinal sense in so far as instantaneous public access, going back at best to late -to - mid 90s.  Site disclaimer indicates that periodic recording of data were done so going back to 1965 with nothing mentioned before this date. 

Sort of amazing since one would wonder whether someone were in fact tracking much of this related information. 

Interest in this topic came up over a curiosity and interest driven by an argument.  Namely, concerning groundwater as pertaining to flooding in any given periodic context.  Corp of Engineers looked like a more promising look, but tired of the moment in the effort to filter through a lot of useless search results.  


Thursday, July 5, 2012

Lunopolis
In the Troll Hunter genre, X files stuff, can you say more. 
Sort of laughing at this movie with funny time travel sequence at the end.

No offense to Scientologist s rumor gossip crap gets old.
http://articles.cnn.com/2012-07-02/tech/tech_social-media_google-plus-not-dead_1_google-last-week-google-friend-social-network?_s=PM:TECH

Hmm... CNN with respectable names like Martin Savidge and the like, and out of a three network cable viewership race with prolly at best less then a million and a half viewership a day for one program, out of 300 million plus population, Cable news of this sort is certain well aimed at popular readership.  I know easier to criticize more modest ventures of social communication, certainly if you guys were held to the same socially serving profitable standards that Facebook retains, you guys might be worried about your market viability likewise?

I mean having the decades of name luxury without account to viewership or site traffic all the same, means that you modestly care with respect to the audience that you cater, but then gauging the potential of viewership and readership here and otherwise lack luster performance otherwise, one wonders about media in general.

Why I'd almost wonder whether Google + site traffic is on par with some of site and cable news traffic?  May not be good, but relatively speaking:  The pot calling the kettle black?

Or laughably when you have a supposed expert 'dietician' on your program that describes healthy vegetarian dietary eating typically as a bag of greens and a few apples.  Yeah, maybe vegetarians eat this way somewhat, but the equivalent of lobbing a hunk of uncooked tofu on a plate and calling this a viable day in day out diet makes one only laugh all the more, certainly you could do a little better then that with some feigned catering, and it should seem quite plausible that your expert could care little other then paying lip service to the proclaimed diet they were espousing.  

 

Tuesday, July 3, 2012

Lol, so much the concerted effort to drive someone out of yet another game...leaving Eve soon.
   
WoW was one of those other lame MMOs to do much the same, not so welcoming, a real bigoted crowd over there, but hey would you expect otherwise without saying so much generally pulling game play issue stunts from what I could see but hey with Chuck Norris as your spokesperson couldn't it be more obvious?!

Honestly windows games generally run smoother on Windows and less so on Linux, that's the reality likely holding some users to their windows PC, but generally if I hadn't been gaming as of recent, I'd probably be on Linux a lot more.  Generally ran dedicated with Linux for over a year, still dedicated on several computers at least, and have newer stuff on Windows 7.  Generally as to gaming, just complaining, been a diversion for awhile, time to move on.

Anyways inspired some extra stuff out of game as far as sql stuff that I hadn't done in a long time that I were rusty on, so it weren't a total waste of time...some it seems may have taken it the wrong way?!   Not really for hack purposes, I mean if I were a developer working for software firm, any database gui work like I did would be legitimate, but when some 'idiot' gamer is involved in such a project, they are more likely one of those sad 'loser' hacks trying to engineer problems for people?    

Complaining is a bit of why bother mostly.  I mean the thankful welcome back to WoW was more likely the account supposedly maliciously tampered with by a key logger with someone having left the toon dropping from the heights of Hyjal.  Then apparently deal with the in game rent a cops roleplaying as usual like before as likely.

I don't know maybe its just me anyways.  Its more like the games should have these sorts of disclaimers like 'We don't really care who you are.  If you don't fit the bill and mold your patronage is not welcome.'  But that's putting it nicely.  I mean I could understand more legitimately issues pertaining to a legal matter, but then if its selective discrimination with respect to the client for other matters...only suggested and so forth.   In any event, you fork out enough money to turn around and be gunned incessantly in some manner, I mean what sort of idiot pays people to gun them right?!  So one tires of the situation and moves on, its not likely complaining rightly over any number of issues were being too self serving and too right in so far as saying something about it.  I mean people talk trash with respect to politics all the freaking time, complaining when they get bad service from their government, but its taboo to complain about private industry?  Double standard.  Complain all of you want as far as I see it, private industries probably more often deserve it.  One quits, tiring of playing patsy to really lame bad industry fodder eventually right?!  Not really much for boycotts really honestly, reading series you'd hardly see much of a complaint.  Last time I left a game, I complained with a warning blog post, then a final ending blog.  Generally up till now was generally considering this a keep to last post, be over move on done with it, and that's generally where my stances have stayed.  Blizz could be a success for all I care, except that I probably won't ever be playing a game of theirs again, like so many other mmos.  Generally last time I played EVE was more likely a brief reactivation stint for a short time to see what were up, like this time around and in passing time to do something else.  Back a couple years or so ago, social attitudes were generally quiet, people were generally cool in game (didn't say much, didn't really mess with you much)...that sort of games fine by me...when these games get really aggressive social attitudes with crap going on left and right to the mechanics because someone's got a social agenda and problem with you being there and when you haven't done or said anything and left people alone or don't cause people other problems, pretty messed up if you ask me.

In any event, have fun...



The not so great VLC application

Not to make this post such a negative one, but I really get tired of the more obvious freeware that one downloads that should be so obnoxious.  VLC player seems to be one of those stinky applications that not only modifies your browser complete with tool bars, but also the add page page tab on your browser, alongside start page, alongside setting off the local virus protection.  Not such a great app in my opinions.  As always a problem occurring what else but windows, so saved desired bookmarks and reinstalled Firefox for a bit of inconvenience to restore some previous desired order to the browser.  

Sunday, July 1, 2012

Math programming issues to consider

Two recent issues encountered recently when doing basic math operations and why they might occur:

1.  Division by Zero.  Commonly likely to occur when you are dividing elements of one container set with elements of another, or for something as simple as algorithms pertaining to statistical measures like means.  If you have an empty container set, in this case, you'd have a division by zero error.  Either introduce something like a control statement prior to entering math operation firstly and make sure you account for this if expected returns are to be provided sequentially later, or you could flag the zero set and so forth.  A little bit of added accounting here for this contingency but probably a good thing to have when you couldn't be too self sure about the data fed into your computations.  Any divisions should have some accounting like this I would offer.

2.  Root of negative numbers yielding a completely different return type.  This occurs in the following instance.  B > A where square_root(A - B) leads to a complex number.  This can occur in the case of things like statistical computations.  If for any given set of data the following inequality holds, A > B, then recheck your math formulation to make sure computation is correct otherwise consider this problem, or this could be merely by way of the expression set that you are using, or in other words it maybe possible that the formulas expression were missing something like square_root ( absolute_value(A-B))?  Ways of checking for possible values sets here:  If a formulas equivalent re expression is situated in the following manner where we have:  C, D such that  square_root ( square(C - D))  Irrespective of whether  C < D  , this equivalent re expression of the formula above implies that the term square(C - D) is always a positive number hence its its square root should always be a non complex return type unless  you have already situated the number as a complex number in your mathematical operations.  Checking your formulation by way of re expressing it is also another way to confirm stability in the return of your data type or avoiding cast type conversion problems.  Anytime you perform a square root in a given series of mathematical operations, there maybe the possibility of a complex number return type.

Oblivion

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