Jump to content

osiris_dev

Member Since 12 Sep 2011
Offline Last Active Apr 07 2017 01:22 AM

Topics I've Started

FBX Transformation problem

03 June 2016 - 04:48 AM

Hello,

 

I am trying to import data from fbx mesh file. I stacked with transformations. There are 2 levels of transformations for geometry in FXB, node and geometry, usually it is only first one, second transform applies on export for positions normal and other 3D data. I have two tested models without skinning. In first one geometry transform is identity, second one has both transforms.

 

The second case is most common in 3DS Max, but I getting correct look for second model if I don't use node transform at all when the first one needs it!!! And it is in one mesh format and I can't understand why.

 

Attached File  ship1.jpg   14.62KB   2 downloads

This is look when I doing geometry transform only

 

 

 

FbxAMatrix 
mGeometryTransform = GetGeometry(pFBXNode);


// transform it to LH if 
needed
if 
(m_bOptionConvertToLH)
{
FbxVector4 
Translation = mGeometryTransform.GetT();
FbxVector4 
Rotation = mGeometryTransform.GetR();

Translation.Set(Translation.mData[0], 
Translation.mData[2], Translation.mData[1]);

mGeometryTransform.SetT(Translation);
}

m_mTransformGeometry = 
GetAFMatrixFromFBX(mGeometryTransform);
 
In vertex 
buffer:
 
iControlPoint = 


pFBXMesh->GetPolygonVertex(i, 
0);
Point = 


pFBXMesh->GetControlPointAt(iControlPoint);
pVertexes->x = 


static_cast<float>(Point.mData[0]);
pVertexes->y = 


static_cast<float>(Point.mData[1]);
pVertexes->z = 


static_cast<float>(Point.mData[2]);
 
// 
node geometry 
transform
AFVector3TransformCoords(pVertexes, pVertexes, 
&m_mTransformGeometry);

 

 

 

 

 

 

 

 

And this when I add Node Transform

Attached File  ship2.jpg   11.59KB   2 downloads

FbxVector4 Translation = 
pFBXNode->LclTranslation;
FbxVector4 Rotation = 
pFBXNode->LclRotation;
FbxVector4 Scaling = 
pFBXNode->LclScaling;

FbxAMatrix 
Transform;
Transform.SetTRS(Translation, Rotation, 
Scaling);
 
pMeshFrame->m_m4x4Transform = 
GetAFMatrixFromFBX(Transform);

 

To get World Transform I making multiplication for hierarchy:

 

 

 

AFMatrixMultiply(&spSceneObject->m_mWorld, 
&spSceneObject->m_mLocal, 
spSceneObject->GetParent()->GetMatrixWorld());

 

 

 

m_mLocal is a m_m4x4Transform transform. I can't use only Geometry Transform or all cases. Any ideas what is wrong here?

 

P.S. Sorry for alignment, can't make it good)


(Solved) string [] problem

26 August 2013 - 07:45 AM

Hello,

  strNum = strPropellerCurName[0];
  strPropellerCurName[0] = 49 + i;

I trying get or put some symbols from/to string in angel script but it fails with "out of range". Have some thoughts? And yes, all strings have info inside more then 1 size, it is just test.


Simple Angel Script Editor

31 May 2013 - 08:09 AM

Hello everyone,

 

I made simple editor for angel script files. Made it according base example "asbuild" from SDK. It is very simple but It have compiler with options to configure your own binding data to script engine. Of course without debugger it is not full IDE but everyone who tried write scripts for game without external compiler should understand my concept.

 

I used "wxWidgets 2.9.4" and "Angel Code 2.25". It is not open source yet because I used engine functions to made it fast. Maybe if someone will be interesting in improving of program then I could publish source.

 

Totem4 Script Editor 1.5 ( updated ): https://www.box.com/s/k51th5alfhcsrl08monc

 

All binding data is in "config.xml".

 

Good luck.


Visual Studio "Generating Code" infinitely

27 June 2012 - 03:26 AM

There was a problem with linking code in release mode. To be more precise after compiling begins "Generating Code" but never ending. I made a couple of tests and found that the reason connect with "Maximaze Speed" flag in C++ Optimization.

I have other projects for VS2010 SP1 but they have not problems.

Any ideas?

Script sees a global variable as null pointer

12 September 2011 - 12:23 AM

Hi all,

There is a small problem. I registered a few global properties.


static LPGameProcessGUI	g_TE3GameProcGUICurrent = NULL;

static LPGameProcessGUI	GetGUIProcContext()
{ 
	return g_TE3GameProcGUICurrent; 
}


	r = asScriptEngine->RegisterGlobalProperty("CTE3GameProcessGUI@ g_TE3GameProcGUICurrent", &g_TE3GameProcGUICurrent); assert( r >= 0);
	r = asScriptEngine->RegisterGlobalFunction("CTE3GameProcessGUI@ GetGUIProcContext()", asFUNCTION(GetGUIProcContext), asCALL_CDECL ); assert( r >= 0);



and singleton

class CTE3ScriptManager
{
protected: 
	static CTE3ScriptManager m_ScriptManager;

	CTE3ScriptManager();

public:
	virtual ~CTE3ScriptManager(void);


static CTE3ScriptManager& Get() { return m_ScriptManager; }
};

 // registry inside class
 r = m_asScriptEngine->RegisterGlobalProperty("CTE3ScriptManager ScriptManager", this); assert( r >= 0);

Inside my script I get null pointer for variables, although in C + + debugger all variables are initialized.

    string strButtonName = "_lv_ButtonName";

//  ScriptManager - thi null
	strButtonName = ScriptManager.GetScriptContextValuesLocal().GetValueNameString(string("_lv_ButtonName"));

	CTE3CIIScreen @pMainScreen = null;

// or this null
 	@pMainScreen        = GetGUIProcContext().GetMainScreen();

AngelScript Runtime: gui_proc_change_screen.as: Null pointer access . line: 6. column: 2

What's wrong?