Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 14, 2019 6:13 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Rotate an object questions
PostPosted: Fri Oct 30, 2009 2:31 pm 
Offline

Joined: Wed Mar 14, 2007 4:44 am
Posts: 27
hi
im beginning in RB and i m disapointed when i want to try to rotate an object for exemple i have triangle name ABC object in rbspace A(5,5,0) B(5,10,0) C(10,10,0) and i would like the triangle roll by exemple from triangle axe C(10,10,0 not from the point of the origin(x0,y0,z0) (because when i use roll fonction, triangle in totality turns by defaut around the origin)
how can i modify that ?
Thks coop regards thierry


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotate an object questions
PostPosted: Sat Oct 31, 2009 6:53 pm 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
Object2d items such as CurveShape, Figureshape , inherit an X and a Y property.
This is the point of rotation, so if you set x= 10, y=10 before you rotate, it should do what you want.

What classes are you using here, though?
Why is there a 3rd value (0)

Is this a 3d object?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotate an object questions
PostPosted: Sun Nov 01, 2009 3:38 am 
Offline

Joined: Wed Mar 14, 2007 4:44 am
Posts: 27
I use RBGL classe and it works in gl view in my example as follow i hve drawn a simple triangle in 3d ,and the axe z is 0 (for beginning) ,i will draw a cube later
but before i want to understand how can i rotate a figure with an other point NOT from the origin
for exemple i have a simple triangle A,b,C i want that my triangle rotate around the C point ...
thks coop regards thierry

I create trimesh :
Dim tm as New RBGLTrimesh
Dim mDisplay as new RBGLGroup3D
// define the vertices
tm.VertexCount =3
tm.VertexPositions.SetXYZ(0, 5, 5, 0 )
tm.VertexPositions.SetXYZ(1, 5, 10, 0 )
tm.VertexPositions.SetXYZ(2, 10, 10, 0 )
tm.HasVertexColors= True
tm.HasVertexNormals=true
tm.VertexColors.Item(0) = &cFF0000
tm.VertexColors.Item(1) =&c00FF00
tm.VertexColors.Item(2) = &c0000FF


// define the triangles
tm.TriangleCount = 1
tm.Triangles.SetABC(0, 0, 1, 2)
tm.RenderBackFaces= True

mDisplay.Append tm

RB3DSpace1.Objects.Append tm
RB3DSpace1.Update
tm.RenderBackFaces = true

//the position of the camera and the ambiance of the scene

DIM V as RBGLVector3D
v= New RBGLVector3D

v.X=7
v.Y=7
v.Z=15
me.RB3dSpace1.Camera.Position=V
Rb3DSpace1.AmbientLight=80

Rb3DSpace1.Update

//the movement of the triangle it turns around the origin ....and i would like that my triangle turns around a point of the triangle
If Rb3DSpace1.Objects <> nil then
Rb3DSpace1.Objects.Roll .05
Rb3DSpace1.Update
end


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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