Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 19, 2019 3:59 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Display the objects in Rb3DSpace
PostPosted: Tue Sep 29, 2009 3:35 am 
Offline

Joined: Thu Feb 22, 2007 7:08 pm
Posts: 1384
I have not much experience with 3D programing or the Rb3DSpace.
Therefore a question. How I can display the objects which I append to Rb3DSpace.Objects?
I simple use this for add the objects:
object1 = new object3d
object2 = new object3d
rb3dspace.objects.append object1
rb3dspace.objects.append object2

In the timer I want display the object1 and object2 in a sequence. But Rb3DSpace should display either object1 or object2.
Pseudocode in the timer:
select case counter
case 0
rb3dspace.display(object1)
counter = 1
case 1
rb3dspace.display(object2)
counter = 0
end select


Top
 Profile  
Reply with quote  
 Post subject: Re: Display the objects in Rb3DSpace
PostPosted: Tue Sep 29, 2009 2:46 pm 
Offline

Joined: Mon Feb 05, 2007 11:35 am
Posts: 98
Based on your pseudocode, try the .Visible property:
select case counter
case 0
object1.Visible = True
object2.Visible = False
counter = 1
case 1
object1.Visible = False
object2.Visible = True
counter = 0
end select


A more elegant method is to load up a single Object3D with both object1 and object2:
Dim obj As Object3D
obj.AddShapeFromFile( object1 folderitem )
obj.AddShapeFromFile( object2 folderitem )

Now you can use the .Shape property to flip between the two:
select case counter
case 0
obj.Shape = 0 // shapes are zero-based
counter = 1
case 1
obj.Shape = 1
counter = 0
end select

_________________
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: Display the objects in Rb3DSpace
PostPosted: Tue Sep 29, 2009 4:21 pm 
Offline

Joined: Thu Feb 22, 2007 7:08 pm
Posts: 1384
I think the second code you write is much better to handle for what I will do later and therefore was exactly what I have in mind.
Work's great. Thank you Jeff.


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group