# Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
 It is currently Fri Aug 14, 2020 11:05 pm

 All times are UTC - 5 hours

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Rotate an object questionsPosted: Fri Oct 30, 2009 2:31 pm

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

 Post subject: Re: Rotate an object questionsPosted: Sat Oct 31, 2009 6:53 pm

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

 Post subject: Re: Rotate an object questionsPosted: Sun Nov 01, 2009 3:38 am

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC - 5 hours

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

Search for:
 Jump to:  Select a forum ------------------ General    General    Getting Started    Networking    Databases    Visual Basic to REAL Studio Conversion    Games    Plugins    Tips    Web Control SDK Platform Specific    Windows    Macintosh    Linux    Web Other Topics    Announcements    Off-Topic    Third Party Add-ons