Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 7:24 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: About object3d's center
PostPosted: Thu Feb 04, 2010 4:38 am 
Offline

Joined: Mon Sep 28, 2009 1:29 am
Posts: 32
I wonder what's the simple way to change object3d's center?
Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: About object3d's center
PostPosted: Thu Feb 04, 2010 12:56 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
There's a few ways I can think of:
1. Simply add an offset position to your Object3D. Of course, that will only work with position; you'll need to use more math to help with rotation and scaling.

2. Use Trimesh.VertexPositions.AddToAll to offset every vertex in your mesh. This only works for Trimeshes and not for Object3Ds (vertices are immutable in Object3Ds). You could take each Trimesh in an Object3D, do the offset, then add all the Trimeshes back into a Group3D to recreate your Object3D (see scale drawback below). If your Object3D has only one Trimesh, then you're golden: ditch the Object3D by copying the mesh to a new Trimesh and using that instead.

3. Add your object to a Group3D and offset the position so that it's centered the way you want. The drawback is that you can no longer scale (Group3Ds cannot be scaled). While you can scale the Object3D itself, It won't scale up at the Group3D's center of origin.

In the end, I've found the best way is to make sure the object is built centered properly in the first place, thus avoiding all the hassles I've listed above.

_________________
Regards,

Jeff Quan
jeff@jcquan.com
http://www.jcquan.com/JQportfolio
My RBGL replacement classes: http://www.jcquan.com/REALbasic


Top
 Profile  
Reply with quote  
 Post subject: Re: About object3d's center
PostPosted: Fri Feb 05, 2010 4:08 am 
Offline

Joined: Mon Sep 28, 2009 1:29 am
Posts: 32
Thanks but...

I'm sorry to don't be agree with you about
"the best way is to make sure the object is built centered properly in the first place"
because if i want yaw, roll or pitch in other point of object3d....

gianfranco


Top
 Profile  
Reply with quote  
 Post subject: Re: About object3d's center
PostPosted: Fri Apr 02, 2010 11:38 am 
Offline

Joined: Mon Sep 28, 2009 1:29 am
Posts: 32
I have partially solved the problem...
who should help me to solve completelly???
You can see my problem here: http://www.abbici.org/study.zip

thanks

gianfry


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group