Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Alundra

Member Since 19 Jul 2011
Offline Last Active Yesterday, 07:41 PM

Posts I've Made

In Topic: Translate Gizmo / Scale Gizmo Y-Axis

27 January 2015 - 08:00 PM

For rotation I use an easier solution which is to do a ray-plane and test the distance from center.


In Topic: Translate Gizmo / Scale Gizmo Y-Axis

27 January 2015 - 05:30 PM

I use the Ray-OBB to test axis of the translation/scale gizmo and ray-plane for the rotation gizmo.

For the intersection ray-plane works good but try when you are parallel of your plane and you will see it's impossible to move or scale or rotate correctly.


In Topic: Translate Gizmo / Scale Gizmo Y-Axis

20 January 2015 - 06:36 PM

Yeah that's the only way I see to have this working, compute one orientation of the plane based on camera like for particle system when you orient based on velocity.

This orientation has to be stored to compute the local version of the intersection which is sent to each actors.


In Topic: Translate Gizmo / Scale Gizmo Y-Axis

20 January 2015 - 03:50 PM

The axis is selected using a ray-obb intersection then a ray-plane is made to compute the delta of last intersection with the current, this value is then sent to AddTranslation/AddScale using local or world to convert the delta on the good space. The problem is you can easily be parallel to the plane, that's why a way has to be found to avoid this case the most possible. The post is named for Y-Axis but with test, the problem is on the 3 axis. The only correct option I have in head is to orient the plane to always be front of the camera but always oriented on the up using the axis selected. If you rotate around the Y axis, the plane will always be oriented front of the camera but always has up axis to (0,1,0) in world space and in local space has the up axis of the last selected.


In Topic: Ray-Billboard/Ray-Quad intersection

14 January 2015 - 02:29 PM

works good :

bool CBillboardComponent::IntersectRay( const CRay& Ray, float* t ) const
{
  const CPlane Plane = CPlane( m_Owner->GetForwardVector(), m_Owner->GetWorldTranslation() );
  if( CIntersection::IntersectRayPlane( Ray, Plane, t, false ) == false )
    return false;
  const CVector3 IntersectionPoint = m_Owner->GetWorldMatrix().Inversed().Transform( Ray.GetPoint( *t ) );
  return ( CMath::Abs( IntersectionPoint.x ) <= 0.5f ) && ( CMath::Abs( IntersectionPoint.y ) <= 0.5f );
}

PARTNERS