Render Point Clouds with Three.js in Autodesk Forge using BufferGeometry
up vote
0
down vote
favorite
I'm trying to render point clouds using Autodesk Forge's viewer. This works fine using THREE.Geometry
as described here https://forge.autodesk.com/blog/using-pointcloud-forge-viewer. In this article it is specified that one cannot use BufferGeometry.
However, I want to be absolutely sure if there's any way of using PointCloud with BufferGeometry without having to create a THREE.Geometry
. I already have the data as Float32Array
for the points and Uint8Array
for colors so putting them in THREE.Vector3
s feels like a lot of overhead here.
Looking through the source https://autodeskviewer.com/viewers/latest/viewer3D.js there's some mention of point cloud buffers, (search for createPointCloudBuffers(geometry)
.
Edit:
When trying to use THREE.BufferGeometry with THREE.PointCloud
with:
const geometry = new THREE.BufferGeometry();
geometry.addAttribute('position', new THREE.BufferAttribute(position, 3));
geometry.addAttribute('color', new THREE.BufferAttribute(color, 3));
const pc = THREE.PointCloud(geometry, <material>);
I'm getting the following message:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look at renderBufferDirect function in https://autodeskviewer.com/viewers/latest/viewer3D.js)
autodesk-forge autodesk-viewer
add a comment |
up vote
0
down vote
favorite
I'm trying to render point clouds using Autodesk Forge's viewer. This works fine using THREE.Geometry
as described here https://forge.autodesk.com/blog/using-pointcloud-forge-viewer. In this article it is specified that one cannot use BufferGeometry.
However, I want to be absolutely sure if there's any way of using PointCloud with BufferGeometry without having to create a THREE.Geometry
. I already have the data as Float32Array
for the points and Uint8Array
for colors so putting them in THREE.Vector3
s feels like a lot of overhead here.
Looking through the source https://autodeskviewer.com/viewers/latest/viewer3D.js there's some mention of point cloud buffers, (search for createPointCloudBuffers(geometry)
.
Edit:
When trying to use THREE.BufferGeometry with THREE.PointCloud
with:
const geometry = new THREE.BufferGeometry();
geometry.addAttribute('position', new THREE.BufferAttribute(position, 3));
geometry.addAttribute('color', new THREE.BufferAttribute(color, 3));
const pc = THREE.PointCloud(geometry, <material>);
I'm getting the following message:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look at renderBufferDirect function in https://autodeskviewer.com/viewers/latest/viewer3D.js)
autodesk-forge autodesk-viewer
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to render point clouds using Autodesk Forge's viewer. This works fine using THREE.Geometry
as described here https://forge.autodesk.com/blog/using-pointcloud-forge-viewer. In this article it is specified that one cannot use BufferGeometry.
However, I want to be absolutely sure if there's any way of using PointCloud with BufferGeometry without having to create a THREE.Geometry
. I already have the data as Float32Array
for the points and Uint8Array
for colors so putting them in THREE.Vector3
s feels like a lot of overhead here.
Looking through the source https://autodeskviewer.com/viewers/latest/viewer3D.js there's some mention of point cloud buffers, (search for createPointCloudBuffers(geometry)
.
Edit:
When trying to use THREE.BufferGeometry with THREE.PointCloud
with:
const geometry = new THREE.BufferGeometry();
geometry.addAttribute('position', new THREE.BufferAttribute(position, 3));
geometry.addAttribute('color', new THREE.BufferAttribute(color, 3));
const pc = THREE.PointCloud(geometry, <material>);
I'm getting the following message:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look at renderBufferDirect function in https://autodeskviewer.com/viewers/latest/viewer3D.js)
autodesk-forge autodesk-viewer
I'm trying to render point clouds using Autodesk Forge's viewer. This works fine using THREE.Geometry
as described here https://forge.autodesk.com/blog/using-pointcloud-forge-viewer. In this article it is specified that one cannot use BufferGeometry.
However, I want to be absolutely sure if there's any way of using PointCloud with BufferGeometry without having to create a THREE.Geometry
. I already have the data as Float32Array
for the points and Uint8Array
for colors so putting them in THREE.Vector3
s feels like a lot of overhead here.
Looking through the source https://autodeskviewer.com/viewers/latest/viewer3D.js there's some mention of point cloud buffers, (search for createPointCloudBuffers(geometry)
.
Edit:
When trying to use THREE.BufferGeometry with THREE.PointCloud
with:
const geometry = new THREE.BufferGeometry();
geometry.addAttribute('position', new THREE.BufferAttribute(position, 3));
geometry.addAttribute('color', new THREE.BufferAttribute(color, 3));
const pc = THREE.PointCloud(geometry, <material>);
I'm getting the following message:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look at renderBufferDirect function in https://autodeskviewer.com/viewers/latest/viewer3D.js)
autodesk-forge autodesk-viewer
autodesk-forge autodesk-viewer
edited Nov 12 at 9:20
asked Nov 9 at 15:29
simen-andresen
6212823
6212823
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You might be in luck! Looking at THREE r71 code https://autodeskviewer.com/viewers/latest/three.js
you can find the point cloud implementation by searching for the text...
THREE.PointCloud = function ( geometry, material ) {
notice the input is this.geometry
. Now scroll down a few lines down, to find code that shows support for THREE.BufferGeometry
as well, here...
if ( geometry instanceof THREE.BufferGeometry ) {
Modify these lines of code:
https://github.com/wallabyway/markupExt/blob/fcce2940379ffd9dc27065fa8dd9b34cd37f8ef0/docs/markupExt.js#L92-L96
from using 'THREE.Geometry' to 'THREE.BufferGeometry'
like this...
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array( [ -1.0, -1.0, 1.0, etc ]);
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );
Essentially modifying this example to use BufferGeometry...
https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
Let me know if that helps
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)
– simen-andresen
Nov 12 at 9:16
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You might be in luck! Looking at THREE r71 code https://autodeskviewer.com/viewers/latest/three.js
you can find the point cloud implementation by searching for the text...
THREE.PointCloud = function ( geometry, material ) {
notice the input is this.geometry
. Now scroll down a few lines down, to find code that shows support for THREE.BufferGeometry
as well, here...
if ( geometry instanceof THREE.BufferGeometry ) {
Modify these lines of code:
https://github.com/wallabyway/markupExt/blob/fcce2940379ffd9dc27065fa8dd9b34cd37f8ef0/docs/markupExt.js#L92-L96
from using 'THREE.Geometry' to 'THREE.BufferGeometry'
like this...
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array( [ -1.0, -1.0, 1.0, etc ]);
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );
Essentially modifying this example to use BufferGeometry...
https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
Let me know if that helps
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)
– simen-andresen
Nov 12 at 9:16
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
add a comment |
up vote
0
down vote
You might be in luck! Looking at THREE r71 code https://autodeskviewer.com/viewers/latest/three.js
you can find the point cloud implementation by searching for the text...
THREE.PointCloud = function ( geometry, material ) {
notice the input is this.geometry
. Now scroll down a few lines down, to find code that shows support for THREE.BufferGeometry
as well, here...
if ( geometry instanceof THREE.BufferGeometry ) {
Modify these lines of code:
https://github.com/wallabyway/markupExt/blob/fcce2940379ffd9dc27065fa8dd9b34cd37f8ef0/docs/markupExt.js#L92-L96
from using 'THREE.Geometry' to 'THREE.BufferGeometry'
like this...
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array( [ -1.0, -1.0, 1.0, etc ]);
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );
Essentially modifying this example to use BufferGeometry...
https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
Let me know if that helps
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)
– simen-andresen
Nov 12 at 9:16
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
add a comment |
up vote
0
down vote
up vote
0
down vote
You might be in luck! Looking at THREE r71 code https://autodeskviewer.com/viewers/latest/three.js
you can find the point cloud implementation by searching for the text...
THREE.PointCloud = function ( geometry, material ) {
notice the input is this.geometry
. Now scroll down a few lines down, to find code that shows support for THREE.BufferGeometry
as well, here...
if ( geometry instanceof THREE.BufferGeometry ) {
Modify these lines of code:
https://github.com/wallabyway/markupExt/blob/fcce2940379ffd9dc27065fa8dd9b34cd37f8ef0/docs/markupExt.js#L92-L96
from using 'THREE.Geometry' to 'THREE.BufferGeometry'
like this...
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array( [ -1.0, -1.0, 1.0, etc ]);
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );
Essentially modifying this example to use BufferGeometry...
https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
Let me know if that helps
You might be in luck! Looking at THREE r71 code https://autodeskviewer.com/viewers/latest/three.js
you can find the point cloud implementation by searching for the text...
THREE.PointCloud = function ( geometry, material ) {
notice the input is this.geometry
. Now scroll down a few lines down, to find code that shows support for THREE.BufferGeometry
as well, here...
if ( geometry instanceof THREE.BufferGeometry ) {
Modify these lines of code:
https://github.com/wallabyway/markupExt/blob/fcce2940379ffd9dc27065fa8dd9b34cd37f8ef0/docs/markupExt.js#L92-L96
from using 'THREE.Geometry' to 'THREE.BufferGeometry'
like this...
var geometry = new THREE.BufferGeometry();
var vertices = new Float32Array( [ -1.0, -1.0, 1.0, etc ]);
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( vertices, 3 ) );
Essentially modifying this example to use BufferGeometry...
https://forge.autodesk.com/blog/3d-markup-icons-and-info-card
Let me know if that helps
answered Nov 10 at 3:56
michael beale
29113
29113
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)
– simen-andresen
Nov 12 at 9:16
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
add a comment |
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)
– simen-andresen
Nov 12 at 9:16
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)– simen-andresen
Nov 12 at 9:16
Thanks. Have you actually got it working though ? I've tried this, but I'm getting the following:
Only THREE.Mesh can be rendered by the Firefly renderer. Use THREE.Mesh to draw lines.
(Look for relevant code in autodeskviewer.com/viewers/latest/viewer3D.js)– simen-andresen
Nov 12 at 9:16
1
1
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
ah, now I see. Let me ask the team and find out if there is a workaround (and possibly future support coming)...
– michael beale
Nov 19 at 21:26
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
Thanks Michael, that would be great! Not being able to use BufferGeometry for point clouds makes our webapp quite slow since we need to convert the buffers we have into THREE.Vector3D vertices etc before rendering
– simen-andresen
Nov 20 at 8:44
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228664%2frender-point-clouds-with-three-js-in-autodesk-forge-using-buffergeometry%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown