# Using nyar4psg library for augmented reality

**URL:** https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992
**Category:** Libraries
**Created:** [March 18, 2019, 12:11pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992 "2019-03-18T12:11:54Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 18, 2019, 12:11pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/1 "2019-03-18T12:11:54Z")

</div>

Hi,

I am using the **nyar4psg library for augmented reality**. I am able to see the 3d cube in the below picture in my tablet when its camera is pointing to a marker image, but how is it coming out on the paper. I mean how is it projected in the real world? Its not coming out as in the below picture for me, its showing only in the phone/tablet. Could you please help. Is it some sort of digitized or image tracking paper?

![image.png](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7aec0f742b714705020500ae14b972b52791b4b1.png)

Regards,

Padma

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 18, 2019, 4:32pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/2 "2019-03-18T16:32:30Z")

</div>

No, it is normal paper. The content appears only on the screen of the phone / tablet. Like this:

[![](https://img.youtube.com/vi/hMMGICOb4wc/maxresdefault.jpg "AR TABLET EXAMPLE") ](https://www.youtube.com/watch?v=hMMGICOb4wc)

Augmented reality is not projected in the real world. It is displayed on a phone / tablet / headset / glasses.

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 19, 2019, 3:48am UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/3 "2019-03-19T03:48:04Z")

</div>

![image.png](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8ee104c7b2954670fc007d66d1ba629587ddcff9.png)

In the above video, he has executed the processing code and the cube has come out of the system. Do we need any extra hardware for that?

Regards,

Padma

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 19, 2019, 11:46am UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/4 "2019-03-19T11:46:25Z")

</div>

maybe its some sort of surface projector.

Regards,

Padma

![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8ee104c7b2954670fc007d66d1ba629587ddcff9.png)

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 19, 2019, 3:01pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/5 "2019-03-19T15:01:48Z")

</div>

> [@padmakn](#):
>
> n the above video, he has executed the processing code and the cube has come out of the system.

No, he hasn’t.

He is in front of his laptop, recording it with a camera or web cam. The video stream gets the cube added to it by processing, using video processing. He cannot see the cube in the air in front of him – it isn’t there. He can only see the cube through his laptop screen – it is never projected into the real world.

Watch this part closely. He can’t see the cube in his hand, because it isn’t projected – he can only see it on his screen. That is why he is watching his laptop so carefully.

[![](https://img.youtube.com/vi/Xdq-vnM86lY/maxresdefault.jpg "augmented reality with free tools - lesson2B") ](https://www.youtube.com/watch?v=Xdq-vnM86lY&t=1301)

There are ways to project onto fiducials from a fixed perspective, but they are usually not close-up 3D – they are either top-down onto tables or floors like reactable, or else they are onto the side of a building like projection mapping. You can have projectors map 2D videos (not cubes!) onto moving 2D surfaces with fiducials – like a sign on a stick – but it is hard to get right, and it works much better with 2D than with 3D due to needing to force a perspective.

The setup in this particular video doesn’t use a projector at all.

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 19, 2019, 4:59pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/6 "2019-03-19T16:59:36Z")

</div>

Yeah you are right. Maybe we could use a desktop projector to see our screen on the surface to see a 3d view of the cube as it appears in 3d in the screen.

Thanks,

Padma

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 19, 2019, 5:45pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/7 "2019-03-19T17:45:08Z")

</div>

Sure, although projecting a 3D object on a surface will only look 3D from a fixed perspective. As you move, the illusion breaks.

If you want to mix projection with AR, you might want to look at TUIO / reactivision, which works with Processing.

[http://www.tuio.org/](http://www.tuio.org/)

It will be easier to give advice if you share many more details about what you are trying to accomplish with your project.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 19, 2019, 7:52pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/8 "2019-03-19T19:52:34Z")

</div>

You might also be interested in PapARt, which works with projection – although, again, it does 2D and some projection mapping, not 3D.

- [PapARt: Paper Augmented Reality Toolkit – A Processing library](https://project.inria.fr/papart/)
- [GitHub - natar-io/PapARt: Paper Augmented Reality Toolkit - interactive projection for Processing](https://github.com/poqudrof/PapARt)
- [new Augmented Reality Library - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/12341/new-augmented-reality-library)

[![](https://img.youtube.com/vi/bMwKVOuZ9EA/maxresdefault.jpg "Augmented Reality, projection with Processing and PapARt") ](https://www.youtube.com/watch?v=bMwKVOuZ9EA)

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 19, 2019, 9:49pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/9 "2019-03-19T21:49:06Z")

</div>

its for a molecular representation project.

Thank you!

Regards,

Padma

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 19, 2019, 9:54pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/10 "2019-03-19T21:54:17Z")

</div>

I mean a chemistry molecular project.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 19, 2019, 9:57pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/11 "2019-03-19T21:57:49Z")

</div>

Perhaps consider a pyramid hologram display, if you want a simple / cheap tangible 3D tabletop interface that can display a 3D model.

> [@Code to transform content for Holographic Pyramid with PGraphics](https://discourse.processing.org/t/code-to-transform-content-for-holographic-pyramid-with-pgraphics/6277):
>
> Hello everyone I’ve created a code that can transform a three-dimensional content into holographic video for pyramid. For the purposes of example, a three-dimensional shape taken from the Processing examples was used. The content has been enclosed in a class called videoCreate. The algorithm provides for the adaptation of the video on LCD screens with different sizes in inches. Visual material within the beginDraw() and endDraw() functions can be replaced with any design…

---

<div class="post-metadata">

### Author: ![padmakn](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@padmakn](https://discourse.processing.org/u/padmakn)
#### Post date: [March 20, 2019, 3:55pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/12 "2019-03-20T15:55:20Z")

</div>

I will go through it.

Thank you,

Padma

---

<div class="post-metadata">

### Author: ![olotropic\_world](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olotropic_world/32/2568_2.png) [@olotropic\_world](https://discourse.processing.org/u/olotropic_world)
#### Post date: [October 19, 2020, 12:17pm UTC](https://discourse.processing.org/t/using-nyar4psg-library-for-augmented-reality/23992/13 "2020-10-19T12:17:35Z")

</div>

If you have any questions about the code for creating a holographic image, feel free to ask
