how to update geometry vertex position in three.js r58? - geometry

in the version r56 of three.js this was working
geometry.verticesNeedUpdate = true
in the new r58 version it is not, what should I do?

The migration docs explain API changes between versions:
If you are using BufferGeometry, geometry.verticesNeedUpdate has been changed to geometry.attributes.index.needsUpdate.

Related

setWorldRotationFromEuler is creating issue in cocos creator 3.4

I am trying to develop helix jump in Cocos creator 3.4 but I don't know how to make it smooth
When I try to use setWorldRotationFromEuler it moves the tower but when I click on same position it moves back to initial touch pos.
input.on(Input.EventType.TOUCH_MOVE
, function(touch){
this.node.setWorldRotationFromEuler(0 ,touch.getLocationX()/2 ,0)
},this)
input.on(Input.EventType.TOUCH_MOVE
, function(touch){
var qout1=Quat.toEuler(new Quat,this.tower.getRotation())
this.node.setWorldRotationFromEuler(0,(qout1.y+touch.getDeltaX()/3),0)
},this)
}
this will resolve the issue

Python - Search plugin of Folium doesn't appear

I'm trying to reproduce the following jupyter notebook :
https://nbviewer.jupyter.org/github/jtbaker/folium/blob/geojsonmarker/examples/plugin-Search.ipynb
But once I'm trying to create the map I had to make a few changes to the search plugin because of the documentation:
citysearch = Search(layer=citygeo,
geom_type='Point',
placeholder="Search for a US City",
collapsed=True,
search_label='nameascii'
).add_to(m)
becomes, according to the folium documentation here :
citysearch = Search(data=citygeo,
geom_type='Point',
search_label='nameascii'
).add_to(m)
The issue is that, at best the search plugin doesn't appear and at worse my folium map isn't displayed. Does anyone have this problem as well ? Or is there any dependecies I've forgot ?
Alright found the solution after couple days of research,
The example in the notebook is using a new search.pyfile which isn't updated in the folium document yet (as the working version is from december 23 2018 so it's very recent)
I just went to the pluginfolder to change the search.py with the github newest version Here Then it doesn't update automatically to my notebooks so I just created a new one and there it works !
OR simpler way : update folium to version 0.8.0 and it will work so just do pip install folium==0.8.0 (just went out yesterday)
I have the same problem as you. When you press F12 in your browser, you'll see that there's an JS-error. I tried replacing data=citygeo by data=citygeo.to_json() - which will display your map - but still doesn't show the searchbox.
My guess it has something to do with a bug in the latest new version of Folium. Hopefully it gets fixed soon.

WebStorm React d3 library force()

I have a really strange problem with my libraries in WebStorm. I have been trying to find out why this does not work, but nobody seem to have the exact problem I am having, maybe because I search bad, but I have really tried.
I have followed the WebStorm support, and from their perspective it should work by now! I do not get any fault when installing the libraries with npm.
I also tried installing external libraries:
However, I am trying to use react-d3-library because I am doing a relational graph with d3. I can see that is available in my node modules in my project, the folder was gray and the others orange? Did not really know why... did some research and found something about "Right click on the directory and go to 'Mark Directory as' and select 'Resource Root'" but does not seem to work for me?
When I run this in my browser I get when pressing F12
Uncaught TypeError: Cannot read property 'force' of undefined
at App.componentDidMount (App.js:311)
at ReactCompositeComponent.js:265
at measureLifeCyclePerf (ReactCompositeComponent.js:75)
at ReactCompositeComponent.js:264
at CallbackQueue.notifyAll (CallbackQueue.js:76)
at ReactReconcileTransaction.close (ReactReconcileTransaction.js:80)
at ReactReconcileTransaction.closeAll (Transaction.js:206)
at ReactReconcileTransaction.perform (Transaction.js:153)
at batchedMountComponentIntoNode (ReactMount.js:126)
at ReactDefaultBatchingStrategyTransaction.perform (Transaction.js:140)
Code:
import d3 from 'react-d3-library';
//var d3 = require('react-d3-library);// tried this...
const force = d3.layout.force() // (App.js:311)
.charge(-120)
.linkDistance(50)
.size([width, height])
.nodes(data.nodes)
.links(data.links);
I would really like some help with this... I really do not get why it does not work? It is probably something easy but I have been fighting this the last 3 days...
P.S. Code is here on my github: https://github.com/Thelin90/react-d3.git and i have also checked this before Cannot read property 'force' of undefined (Simple D3 Network graph) This did not help me to solve the actual problem.
As far as I can see it, you are using typings of two different version of d3.js which are not compatible. In v3 there was a layout d3.layout.force in v4 this was changed to d3.forceSimulation with a way difference signature. So depending on what version you use, your code will return a TypeError with v4 but would work with v3.
Ok, I checked your package.json and you are using v4, hence this example will not run.
Ok I tried to translate your example to v4
const force = d3.layout.force()
.charge(-120)
.linkDistance(50)
.size([width, height])
.nodes(data.nodes)
.links(data.links);
const force = d3.forceSimulation(data.nodes)
.force("link", d3.forceLink(data.links).distance(50))
.force("charge", d3.forceManyBody().strength(-120))
.force('center', d3.forceCenter(width / 2, height / 2));

Postgis - migration from 1.5 to 2.3 - workaround

Fellows,
I already had a really hard time trying to make a migration from a postgis 1.5 to 2.3. Actually I had many attempts to do that with all version of postgis: 2.0, 2.1, 2.2 and now 2.3.
As I have spent a few weeks with that, and as I am ready to drop that I keep using my old version of postgresql and postgis, I hope my question finds a echo somewhere...
I only want to migrate one table field, a geometry field. So before trying to do that, I would like to hear if any of you have experience with that:
The idea is to select the field from the old postgis (postgresql 9.2, postgis 1.5), and update the table to the new postgis (postgresql 9.6, postgis 2.3).
Anyone can say anything about it?
EDIT---
I have just tryed to import the table I needed, but I got an error:
violation of constraint "enforce_srid_the_geom".
:(
Thanks a lot.
If you need to migrate just a single table with a geometry column and you are getting troubles with the procedure described here http://www.postgis.org/docs/postgis_installation.html#hard_upgrade
I'd suggest a workaround: create a text field in the old db, e.g. wkt_geom, then execute
update tablename set wkt_geom = st_astext(the_geom)
Now drop the geometry column, export the old db and import into the new one. Then, create the geometry column and
update tablename set the_geom = st_geomfromtext(wkt_geom, SRID_HERE)

Unity 5.0: Sprite.Create error message "!hasError"

I came back to a Unity game that I was working on a couple of weeks ago, using version 4.6.1. After upgrading to version 5.0 and converting the project, there was an error in the following line:
Sprite.Create(plusTexture, Rect(toRightBoundry, 0, plusTexture.width, plusTexture.height), rightPos);
The image is imported as a single Sprite , 150 pixels per unit, pivoted at the center, using a bilinear filter. The import mode is compression , with a max size of 1024. Given those conditions and the fact that this piece of code was not altered since the working version and also after confirming that all values passed are valid, the following error is found at runtime:
"!hasError"
I have researched in the forums and cannot find a solution for this, mostly topics that end in the developers asking for a bug report. Is anyone familiar with how to solve this issue ?
Thanks in advance and have a nice day
it looks like an error do to unresolved merge conflicts from sprite atlas meta file of the resource file. We were getting a few funny named errors lie"aabb is not define" "!hasError" and something WIPPE. On of them was due to artist not resolving conflicts on a mesh meta file

Resources