realbasic-games
[Top] [All Lists]

How to find a Group3D in a RB3DSpace

To: realbasic-games at lists dot realsoftware dot com
Subject: How to find a Group3D in a RB3DSpace
From: "Heinz J. Gattringer" <heinzjos at uio dot satnet dot net>
Date: Wed, 16 Feb 2005 15:58:41 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <20050216180024 dot B929D72ABE2 at lists dot realsoftware dot com>
Greetings again,

I was happily plodding along with my RTS game in the spritesurface until enough of you hinted at trying out the RB3DSpace. Well, I did somewhat reluctantly because I read that Quesa was only sort of so-so and feared 3D was to much to handle for my low end machine but... I was blown away. What a fine thing this is and it fit my game like a glove.

I have been able to replace quite a lot of complex and awkward code with few lines of convienient build in Object3D methods and properties (mainly direction and orientation stuff) and add a lot of niceties which would have been unthinkable in a spritesurface (related to camera positioning and lighting). But what excites me perhaps the most is the fact that I am getting about 2 times the framerates I was getting on the non graphic card accelerated spritesurface AND with better looking graphics. So I guess I first wish to thank those of you who pushed me in this direction (and rendered many, many hours of sprite-coding useless). But do expect to get bombarded with a completely new set of questions, since I am a total 3D-newbie.

So here comes the first one: The main objects of my game are group3D entities (since they include a rotating gun turret which I want to be able to rotate and orient independently of the whole object even if it is attached to that object). To allow the player to select the different objects in the game I was hoping to use the FindObject method of the RB3D-control together with its Objects property (which is a Group3D as well) and the index of that property. But the index of the RB3D-control's Objects property seems to work only with Object3Ds, not Group3Ds. The funny thing is that all Group3D objects return a index of 0 (not nil, since they are the first objects I appended to the RB3D-Space), and the next appended object3D returns it's logically following index number. So, if I have say 5 Group3Ds and 3 Object3Ds appended to the 3DSpace, I get 5 index numbers of 0 and then correct indexes of 5,6 and 7. This seems strange to me and naturally raised my curiousity.

I have been bypassing the selection problem by getting an object3D at the clicked on spot with the FindObject method, then comparing the x and z coordinates of that object with those of the possible selectable objects and thus determining the correct object. It works, but the dissatisfactory thing about this method is that when the player clicks right on the gun-turrets, he gets no selection, since the coordinates delivered then are very different (I believe they are local to the group3D). Thus the player has to click on the object anywhere but on the gun turret. Not very nice. So I would like to know if any of you knows a better solution to this; and what is up with those index numbers of Group3D objects appended to a RB3D-Space?

Cheers,
Heinz Jose

P.D: Do excuse the long writing, but as I said, I am a bit excited about this RB3D-thing.
P.D.2: Those quaternions are really a heavy lift workout for the brain.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>