Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6566 times and has 4 replies Next Thread
Cinenaut
Newbie




Joined: May 17, 2011
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Server Side

Hello there, what a wonderful tool!
I am implementing this in creating 3D models of French castles for online viewing:
http://cineffect.free.fr/royaume/chateau3d.html

I have two questions:
1. Is it possible to automatically save the rendered photo into a predefined directory on the server (instead of locally on computer)?
2. Is it possible to implement Server Side Rendering of high quality photos?

Thank you,
Ivan
[Feb 3, 2012, 3:11:51 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Server Side

Nice project! smile
1. Is it possible to automatically save the rendered photo into a predefined directory on the server (instead of locally on computer)?
No, please submit a feature request. Meanwhile if you're able to program, you could inspire yourself from PhotoPanel class and the one below.
2. Is it possible to implement Server Side Rendering of high quality photos?
Even if the renderer at the highest quality level doesn't use OpenGL to compute the 3D image, Sweet Home 3D needs Java 3D classes to store the 3D scene. And as soon as you use a Java 3D class in a 3D scene, you're obliged to have at least an opened X11 display if the server is under Linux (on other OS there should be less problem). I guess it's only to check if the display is available in case of need, but as I never tested it myself if there would be other requirements under Linux, I can't tell.
If needed, you could test on a server with the following application:

/*
* ConsolePhotoGenerator.java
*
* Sweet Home 3D, Copyright (c) 2010 Emmanuel PUYBARET / eTeks <info@eteks.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.eteks.sweethome3d.utilities;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import org.sunflow.system.UI;
import org.sunflow.system.ui.ConsoleInterface;
import com.eteks.sweethome3d.io.HomeFileRecorder;
import com.eteks.sweethome3d.j3d.PhotoRenderer;
import com.eteks.sweethome3d.model.Home;
import com.eteks.sweethome3d.model.HomeEnvironment;
import com.eteks.sweethome3d.model.RecorderException;

/**
* Sweet Home 3D Console photo generator.
* @author Emmanuel Puybaret
*/
public class ConsolePhotoGenerator {
public static void main(final String [] args) throws RecorderException, IOException {
String homeFile = args [0];
String homePhoto = args [1];
Home home = new HomeFileRecorder().readHome(homeFile);
HomeEnvironment environment = home.getEnvironment();
PhotoRenderer renderer = new PhotoRenderer(home,
environment.getPhotoQuality() == 3
? PhotoRenderer.Quality.HIGH
: PhotoRenderer.Quality.LOW);
UI.set(new ConsoleInterface());
BufferedImage image = new BufferedImage(
environment.getPhotoWidth(), environment.getPhotoHeight(),
BufferedImage.TYPE_INT_ARGB);
renderer.render(image, home.getCamera(), null);
ImageIO.write(image, homePhoto.substring(homePhoto.lastIndexOf('.') + 1),
new File(homePhoto));
}
}


By the way, don't forget that Sweet Home 3D is distributed under GNU GPL which doesn't give you the freedom to distribute a derived version under a proprietary license. In this is a problem, please contact me and we'll see how to fix this issue.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Feb 3, 2012, 8:25:05 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Cinenaut
Newbie




Joined: May 17, 2011
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: Server Side

Thank you so much Emmanuel, merci!
I will try what you suggest.
By the way in the question #1, what I meant is if it would be possible to implement a HTTP post request to HTML from Java, so that when the user clicks on "save photo", it would automatically be saved on a folder in the server.
I am not a professional java programmer so it is not so easy for me.
I understand the GNU GPL concept and would not want to distribute the license as proprietary in any case.
Last, but not least, as I am a professional cinematographer, if you guys ever need any help with video, streaming, webcasting and so on, I would be glad to contribute my knowledge.
Ivan
[Feb 3, 2012, 2:02:55 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
brianegge
Newbie



United States
Joined: Jul 30, 2020
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
Re: Server Side

Hello Emmanuel,

I know this thread is quite old. I'm trying to get the render to start up on my Mac. I haven't done java development in some time, so hoping to avoid needing to setup Eclipse.

When I compile the above class and run it, the program hangs after creating some warnings:

java -Dj3d.rend=noop -cp .:/Applications/Sweet\ Home\ 3D.app/Contents/Java/SweetHome3D.jar:/Applications/Sweet\ Home\ 3D.app/Contents/Java/sunflow-0.07.3i.jar:/Applications/Sweet\ Home\ 3D.app/Contents/Java/ext/j3dutils.jar:/Applications/Sweet\ Home\ 3D.app/Contents/Java/batik-svgpathparser-1.7.jar:/Applications/Sweet\ Home\ 3D.app/Contents/Java/ext/j3dcore.jar:/Applications/Sweet\ Home\ 3D.app/Contents/Java/ext/vecmath.jar com.eteks.sweethome3d.utilities.ConsolePhotoGenerator ~/Library/Mobile\ Documents/com~apple~CloudDocs/home.sh3d home.png
2020-07-30 15:41:44.117 java[74750:13131131] !!! BUG: The current event queue and the main event queue are not the same. Events will not be handled correctly. This is probably because _TSGetMainThread was called for the first time off the main thread.
2020-07-30 15:41:44.128 java[74750:13131131] pid(74750)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-07-30 15:41:44.147 java[74750:13131131] pid(74750)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
2020-07-30 15:41:44.148 java[74750:13131131] pid(74750)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Please call TIS/TSM in main thread!!!
[Jul 30, 2020, 8:52:38 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Server Side

What version of Java do you use (run the command java -version)? If it’s above Java 8, I would retry with Java 8 (under macOS, JDKs are installed in /Library/Java/JavaVirtualMachines).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 1, 2020, 9:44:29 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved