# Rendering OBJ and CPD issues

**URL:** <https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615>\
**Category:** Questions\
**Tags:** pcd-loader, obj-loader\
**Created:** [September 11, 2020, 12:23pm UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615 "2020-09-11T12:23:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_Santos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sergio_santos/32/13246_2.png) [@Sergio\_Santos](https://discourse.threejs.org/u/Sergio_Santos)\
**Post date:** [September 11, 2020, 12:23pm UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/1 "2020-09-11T12:23:42Z")

</div>

I managed to render a OBJ (exported from a IFC) by adding some lights, but still wondering if there’s a proper light configuration to uniformly light the scene or I might be missing some color information.

Here you can see how the model is rendered in an online viewer vs my script.

 ![Captura de pantalla 2020-09-11 a las 14.16.48](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/b/b28f8bca1a7a265697cff07681aa8dbc2b463d5e.png)  
 ![Captura de pantalla 2020-09-11 a las 14.17.16](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/d/d198fd292b6d9ae92ccf34ea2569edb08aa850bb.png)

On the other hand, I’m still unable to see any of my PCD cloud points (exported from XYZ), even despite of the lights. Not sure if it might be some incompatibility issue, but I can correctly render the PCD in other 3rd party tools.

Next you can find an html file of my tests, one of my ifc models (and the obj export) and a reduced PCD. Any tip in the right direction would be much appreciated.

[tests.html](https://discourse.threejs.org/uploads/short-url/vye6eh2BOAaTDIrxXP8CIoiPwC0.html) (5.0 KB)  
[Proof of concept - Wall.ifc](https://discourse.threejs.org/uploads/short-url/hQPffguue1XcxYX2vT8Lz6KJZMB.ifc) (20.0 KB)  
[Proof of concept - Wall.mtl](https://discourse.threejs.org/uploads/short-url/2dB0GsoylfeUnoQg06uYzFggrdC.mtl) (363 Bytes)  
[Proof of concept - Wall.obj](https://discourse.threejs.org/uploads/short-url/guer0RFZNvNrWELVPIpWigQSmH1.obj) (4.3 KB)

> **[17000.pcd](https://www.dropbox.com/s/iqypcgavgim9wxd/17000.pcd?dl=0)**
>
> Shared with Dropbox

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [September 12, 2020, 2:31pm UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/2 "2020-09-12T14:31:42Z")

</div>

A

> [@Sergio\_Santos](#):
>
> On the other hand, I’m still unable to see any of my PCD cloud points (exported from XYZ), even despite of the lights. Not sure if it might be some incompatibility issue, but I can correctly render the PCD in other 3rd party tools.

The problem is how the `FIELDS` value is defined in your PCD file. It looks like so:

```javascript
FIELDS Scalar_field_#3 Scalar_field_#2 Scalar_field x y z _

```

Normally the loader expects e.g. this pattern:

```javascript
FIELDS x y z

```

Can you please verify first if your PCD file actually conforms to the standard? E.g. `#` is intended to mark a comment. I’m not sure it’s valid to use it in field identifiers.

---

<div class="post-metadata">

**Author:** ![Sergio\_Santos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sergio_santos/32/13246_2.png) [@Sergio\_Santos](https://discourse.threejs.org/u/Sergio_Santos)\
**Post date:** [September 13, 2020, 9:39am UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/3 "2020-09-13T09:39:49Z")

</div>

Thanks @Mugen87 for the quick response. I’m kind of noob so couldn’t really tell wether or not this is standard format. I got the pcd file exporting a .xyz source with [Cloud Compare](https://www.danielgm.net/cc/). The xyz rows look like this.-

2.867840 -8.631088 -1.587943 -5.274897 2.828050 1.904140

Any other tool you would recommend to export to pcd?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [September 13, 2020, 11:19am UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/4 "2020-09-13T11:19:12Z")

</div>

> [@Sergio\_Santos](#):
>
> Any other tool you would recommend to export to pcd?

I only have found [xyz2pcd](https://github.com/clausmichele/xyz2pcd) which is a small wrapper around the PCL library.

---

<div class="post-metadata">

**Author:** ![Sergio\_Santos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sergio_santos/32/13246_2.png) [@Sergio\_Santos](https://discourse.threejs.org/u/Sergio_Santos)\
**Post date:** [September 13, 2020, 5:32pm UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/5 "2020-09-13T17:32:34Z")

</div>

Thanks @Mugen87, I was aware of that one but never managed to get it work, will give it another try just in case.

---

<div class="post-metadata">

**Author:** ![Sergio\_Santos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/sergio_santos/32/13246_2.png) [@Sergio\_Santos](https://discourse.threejs.org/u/Sergio_Santos)\
**Post date:** [September 16, 2020, 9:09am UTC](https://discourse.threejs.org/t/rendering-obj-and-cpd-issues/18615/6 "2020-09-16T09:09:19Z")

</div>

Just in case someone might find it useful:

- Regarding the cloud point, I just manually parsed my .xyz and render it. Looks something like this.-

- I managed to see my model just playing around with the lights and the scale.-
