Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | 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 1554 times and has 4 replies Next Thread
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 164
Status: Offline
Reply to this Post  Reply with Quote 
Curved line camera path

I repeat the problematic that has been discussed in this thread .
The drawing of the curved line is made with Arc2D from 2 main locations, the orientation of the camera and the center of the ellipse.
The intermediate positions are calculated using the parametric equations of the ellipse .

The correlation established with the SH3D coordinate system only works in certain cases.
Here is the part of the code drawing the arc for panoramic videos.
float x1 = cameraPath.get(i - 1).getX();
float y1 = cameraPath.get(i - 1).getY();
float x2 = camera.getX();
float y2 = camera.getY();
double trigAng1 = (Math.PI / 2) - cameraPath.get(i - 1).getYaw();
double trigAng2 = (Math.PI / 2) - camera.getYaw();

if (trigAng1 == trigAng2) { // straight line
g2D.draw(new Line2D.Float(x1, y1, x2, y2));
} else { // curved line
double chord = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
double radius = Math.abs(chord / (2 * Math.sin((trigAng2 - trigAng1) / 2)));

Arc2D circleArc = new Arc2D.Float();
double x = x1 - (radius * Math.cos(trigAng1));
double y = y1 + (radius * Math.sin(trigAng1)); // reversed axis in sh3d
double angSt = Math.toDegrees(trigAng1);
double angExt = Math.toDegrees(trigAng2 - trigAng1);
int closure = Arc2D.OPEN;
circleArc.setArcByCenter(x, y, radius, angSt, angExt, closure);
g2D.draw(circleArc);
}

----------------------------------------
EnkoNyito gallery
[Jul 31, 2017 8:25:11 PM] Show Printable Version of Post    View Member Profile    Send Private Message    https://sites.google.com/site/enkonyitogallery/ [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 5841
Status: Offline
Reply to this Post  Reply with Quote 
Re: Curved line camera path

Could you give more details about when it doesn't work?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Aug 1, 2017 1:01:38 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://www.eteks.com [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 164
Status: Offline
Reply to this Post  Reply with Quote 
Re: Curved line camera path

Using the correlation found, the start angle depends on the orientation of the camera so sometimes the arc is badly drawn.


By discovering that we can use Math.atan2(y, x) to calculate the start angle from the position only, I will orient myself towards this solution.
----------------------------------------
EnkoNyito gallery
[Aug 3, 2017 8:42:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message    https://sites.google.com/site/enkonyitogallery/ [Link] Report threatening or abusive post: please login first  Go to top 
enkonyito
Advanced Member
Member's Avatar


Joined: May 28, 2015
Post Count: 164
Status: Offline
Reply to this Post  Reply with Quote 
Re: Curved line camera path

Problem solved.

----------------------------------------
EnkoNyito gallery
[Aug 8, 2017 8:07:52 PM] Show Printable Version of Post    View Member Profile    Send Private Message    https://sites.google.com/site/enkonyitogallery/ [Link] Report threatening or abusive post: please login first  Go to top 
jdab
Newbie




Joined: Dec 28, 2016
Post Count: 11
Status: Offline
Reply to this Post  Reply with Quote 
Re: Curved line camera path

Hi,
As a fan user of the video mode, I'd love to use these curved line in camera path. As well, a 360° rotation around a central point would be great !
Have these been integrated in SH3D yet, or will they be soon ?
Best regards,
[Dec 5, 2017 11:39:11 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-2017 eTeks - All rights reserved