Comments (4)
Hi @vidaaudrey! Thanks, I'll check out the new unofficial version.
After clicking and logging out the ray for a bit, I wasn't able to determine what the point Vec3 array represents--it's value changes weren't very predictable for me. BUT what I did find was the planeIntersection
method on the Ray object that did exactly what we wanted. ray.planeIntersection([0, 0, 0], [0, 0, 1])
gives me what we're looking for.
from webviz.
What I'd like to write looks like this:
getFloor = () => {
const vertices = [
{ x: FLOOR_LENGTH / 2, y: FLOOR_LENGTH / 2, z: 0 },
{ x: -FLOOR_LENGTH / 2, y: FLOOR_LENGTH / 2, z: 0 },
{ x: -FLOOR_LENGTH / 2, y: -FLOOR_LENGTH / 2, z: 0 },
{ x: FLOOR_LENGTH / 2, y: -FLOOR_LENGTH / 2, z: 0 },
]
const floorPolygonData = [
{
id: 1111,
points: vertices,
color: WORLDVIEW_RGB.clear,
}
]
return (
<FilledPolygons
onClick={this.handleFloorClick}>
{floorPolygonData}
</FilledPolygons>
)
}
In this, the click event would have to get the coordinates of where on the object the click hit. Is there a way to do this?
from webviz.
Hey @conrad the onClick
event does give you a ray
object which contains the raycasting information including dir (direction), origin, and clicked point (all in Vec3 format). Try it out and see if satisfies your requirement.
Regarding on the performance, there is some extra computation in FilledPolygons
to get the points. You could try use Triangles
directly. https://github.com/cruise-automation/webviz/blob/master/packages/regl-worldview/src/commands/FilledPolygons.js#L71
In addition, Worldview 0.2.0
is unofficially available now (ref #177). It has some performance optimizations and you no longer need to pass the id
in. We've been testing it internally with lots of moving objects and PointCloud. Let us know if you have any questions or still see perf drops after you try it out.
from webviz.
Great that your found a work-around. BTW, the new version is available now and here is the migration guide: https://webviz.io/worldview/#/docs/migration-notes/migrating-to-version-0.2.x
from webviz.
Related Issues (20)
- Delayed laserscans when clock times are out of sync HOT 1
- Bag not available HOT 2
- How large rosbag can webviz remote load?
- Consume React components directly HOT 3
- Errors when bootstraping the app HOT 1
- Error in fetching topics and datatypes HOT 1
- npm run bootstrap error
- Wrong visulization when coordinate values are large HOT 1
- Please update the invite HOT 1
- Pause button does not work HOT 2
- Why is the setting for transparency not working? HOT 1
- Can this this application be used as a part of custom application
- Can this application be used as a part of custom application? HOT 2
- Which node version should be used under Windows
- Information on the audio panal?
- Wrong Numeric Interpretation: how to fix? HOT 1
- ROS Demo.bag not available HOT 1
- /dist/vendor.js" Error (404): "Not found HOT 1
- root@ build-static-webviz: `lerna run build && rm -rf __static_webviz__ && cp -r docs/public/app __static_webviz__ && rm __static_webviz__/index.html && cp packages/webviz-core/public/index.html __static_webviz__/index.html && sed -i -- 's/\/dist\/webvizCoreBundle.js/webvizCoreBundle.js/' __static_webviz__/index.html && NODE_ENV=production STATIC_WEBVIZ=true webpack`
- Error: Minified React error #321
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webviz.