Posts

animation - Bone Vertex Skinning transformation -

Image
i trying implement skeletal animation in opengl. @ stage, trying have bone system deform mesh. believe problem how create matrix bone::getmatrix() . background: each bone has offset it's parent, , if bone not have parent offset instead world position of entire skeleton. collection of bones comprise skeleton. currently, testing purposes, have 3 bones in skeleton deforming skinned mesh. again, issue when deforming mesh, visual result not produce desired effect. code: glm::mat4 bone::getmatrix(){ bone* parent = getparent(); glm::mat4 rot = glm::mat4(1.0f); glm::mat4 trans= glm::mat4(1.0f); glm::vec3 orient = getorientation(); //create rotation matrix; rot *= glm::rotate(orient.x,1.0f,0.0f,0.0f); rot *= glm::rotate(orient.y,0.0f,1.0f,0.0f); rot *= glm::rotate(orient.z,0.0f,0.0f,1.0f); //create translation matrix if(parent != nullptr){ glm::vec3 off = offset; trans = glm::translate(off.x,off.y,off.z); ...

iphone - Make 1 UIViewController Landscape Mode -

this question has answer here: force uiviewcontroller show in landscape mode 3 answers my ios app built in portrait format , want keep way. there 1 screen in landscape only, not portrait can't figure how it. is there advised? much appreciated at first should set orientation on supported interface orientation in xcode project summary. in appdelegate: - (nsuinteger) application: (uiapplication*) application supportedinterfaceorientationsforwindow: (uiwindow*) window { nsuinteger orientations = uiinterfaceorientationmaskall; if (self.window.rootviewcontroller) { uiviewcontroller* rootviewcontroller = self.window.rootviewcontroller; uiviewcontroller* presented; if ([rootviewcontroller iskindofclass: [uinavigationcontroller class]]) { presented = [[(uinavigationcontroller*) rootviewcontroller vie...

jquery - store data name equal each class name -

i have html structure below , have store each container inner div text val data, i'm coding below js, works fine feel not smart, because these code kind doing samething store data name equal class name, have type , check typo... possible more simple samething?? <div class="container1"> <div class="aq">text</div> <div class="be">text</div> <div class="co">text</div> <div class="dp">text</div> ... </div> <div class="container1"> <div class="aq">text</div> <div class="be">text</div> <div class="co">text</div> <div class="dp">text</div> ... </div> <div class="container2"> <div class="aa">text</div> <div class="bd">text</div> <div class="cs"...

multiple devise authentication realms in a rails application: which is the setting that allows for that? -

i've simple rails application; has devise authentication mechanism. i've added activeadmin, brings devise based authentication mechanism. there other question , answers merging 2 models. question setting makes 2 authentication realms distinct. example. perform login in admin page: localhost:3000/admin here user model adminuser. then try move regular (non active-admin) page: localhost:3000/documents here user model user. here, if test current_user variable, nil , not instance of adminuser . is: 2 authentication areas (i used word realm don't know if correct) kept distinct. i've searched in activeamdin initializer, couldn't find setting contains information of creating distinct 'authentication realm'. update 1 (and possible answer): they not distinct. if test current_admin_user, contains , adminuser instance. you have 2 models user , adminuser associated 2 separate db tables, right? do have separate aa , user model rout...

perl - is LWP::Simple faster than the full LWP? -

i'm use lwp::simple perl module, understand reduced version of full lwp module. use blindly because suggested use while back. benefit of using on full package, faster , easier use? lwp::simple not faster lwp::useragent since uses lwp::useragent. it's simpler interface.

ElasticSearch grouping facets -

i have document such structure: { id: 312256, name: "somename", filterblocks: [{ id: 0 filtertypeid: 4 filteritems: [ 1190 ] }, { id: 0 filtertypeid: 3 filteritems: [ 353 ] }, { id: 234 filtertypeid: 1 filteritems: [ 6342 ] } ] } for each distinct combination of filterblocks.id+filterblocks.filtertypeid need n size facets on filteritems field. try use query like: { "query": { "match_all": {} }, "facets": { "filterblocks": { "terms": { "field": "filterblocks.filteritems" } } } } but of course n facets without grouping filterblocks.id+filterblocks.filtertypeid what' need modify in que...

html - Javascript - Change element's src in specified element -

in html have lot od divs names(yes, names, not ids) respectively p001, p002, p003... this: <div id="pole" name="p001"><img src=""></div> <div id="pole" name="p002"><img src=""></div> <div id="pole" name="p003"><img src=""></div> etc... in javascript have defined variable called 'pos' contains number, now: "284" , function should change img src "player.png". tried 2 ways , none of these work: document.getelementsbyname('p'+pos).innerhtml='<img src="player.png">'; and document.getelementsbyname('p'+pos).getelementsbytagname("img").src="player.png"; how change img src in specified div? getelementsbyname returns list of elements, not single element, try: document.getelementsbyname('p'+pos)[0]. getelementsbytagname(...