ScratchHome2 - need some help

This topic has been viewed 5499 times and has 8 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

ScratchHome2 - need some help

Post by supseb »

Hi,
as we were working on the new version of ScratchHome, and also extending basic features, you can see our first video demo:
https://www.linkedin.com/posts/kamal-hammi-11bbb61a2_scratchhomev2-activity-6946029336764297216-Udv5?utm_source=linkedin_share&utm_medium=member_desktop_web

We still have some question to enhance our plugin:
- do you know if there's a listener on observer's position in 2D view when we use the 3D virtual visit? We would get X,Y position only if observer has moved.
- where can we find the SVG file of the observer in 2D view?

Thanks!
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: ScratchHome2 - need some help

Post by Puybaret »

You'll need two listeners:
- a first property change listener on home instance to follow the changes of camera (the property name is simply [font=courier new]CAMERA[/font])
- if the new camera is an instance of [font=courier new]ObserverCamera[/font] (the class used for the virtual visitor), add a property change listener on the camera to follow the properties [font=courier new]X Y Z[/font].
Don't forget to remove the first listener when not needed to avoid memory leaks.

There's no SVG file for the virtual visitor. Its drawing is hard coded in PlanComponent class.
Emmanuel Puybaret, Sweet Home 3D creator
supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

Re: ScratchHome2 - need some help

Post by supseb »

Breaking news !!!
Thanks for your help, Kamal worked on plugin and succeeded!
Here are videos:
- First tests of feedback from the character's position in the virtual tour of SweetHome3D to Scratch. https://mediacad.ac-nantes.fr/m/20571


- First tests of event feedback in the virtual tour, by clicking on an object to collect it in a Scratch sensor. https://mediacad.ac-nantes.fr/m/20572
supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

Re: ScratchHome2 - need some help

Post by supseb »

supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

Re: ScratchHome2 - need some help

Post by supseb »

Hello everyone,
I need an expert in SH3D [:D] . In the plugin we did add a listener on the camera (as explained before), everything seems ok but randomly the virtual tour is jerky, very slow.
I had a quick look but I think that a trained eye will find the problem faster than me [;)] : https://github.com/kimokipo/ScratchHome2.0/tree/master/JavaProject/src/com/ScratchHome
Without doing anything in SH3D, activating the virtual tour makes it buggy, sometimes by generating the sb3 file then launching the communication server it works fine. So we don't have too many clues to diagnose the problem.
Thank you for giving us your opinion, we hope to have a finished release during the holidays so that at the beginning of the school year the teachers can use it (the feedback is already very enthusiastic, thank you for this beautiful software that is SH3D).
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: ScratchHome2 - need some help

Post by Daniels118 »

Can you provide all the files and steps required to reproduce the problem?
supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

Re: ScratchHome2 - need some help

Post by supseb »

All files are in the Github repo, and documentation in Wiki if needed.
To reproduce:
- launch SH3D (plugin installed)
- launch 3D view -> virtual tour
And it's buggy.

But if you continue:
- generate sb3 file
- launch ScratchOffline
- open sb3 file
- launch extension from ScratchOffline
- move in SH3D virtual view
and then it resolves pb.

Thanks a lot for helping!
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: ScratchHome2 - need some help

Post by Daniels118 »

I haven't tested it yet, however I think the problem is due to the ScratchListener.runnable field initialized with true. This causes the camera position listener to try to open a huge number of connections which fails since the server isn't running, and I suspect there is a connect timeout which slows down the program.
supseb
Posts: 34
Joined: Fri Jul 27, 2012 12:53 pm

Re: ScratchHome2 - need some help

Post by supseb »

Many thanks! Problem seems solved.
You can see video demo: https://mediacad.ac-nantes.fr/m/20695
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest