More newbie questions

Previous topic - Next topic

SFguy

Hi guys, I have more basic questions and need your help!

I come from a Blitz3D background, where 3D commands seem much easier to use.  I need help on how to deal with multiple 3D objects/entities in GLBasic.  How does GLBasic know which object I want to, say, rotate?  The X_ROTATION command doesn't seem to have a parameter to select the object.  The helpfile states that the command "Rotates the next 3D object..." How does it know what the "next" object is?  Is there a command to select an object to be the "next" object?

Another question (which may be related to the above question) - do I have to X_SETTEXTURE every time I go through a game loop?

Thanks!

kanonet

OpenGL (which is what GLBasic uses) is a state machine, which means, that once you have set something it will stay active for all following objects, until you change it again. GLBasic is in most cases exactly the same. So once you have set e.g. X_ROTATION or X_TEXTURE this will affect all objects that you draw after this command. Normally a new frame will delete all states, so you need to set them again each frame. Setting a state (like setting a textur) is slow, so only set it if its really necessary, e.g. if you have 3 objects that use the same texture, set this texture once and then draw all 3 objects.
Since you come from Blitz3D you will find GLBasic a bit complicated and harder to use, just dont think in Blitz' entitys, GLB 3D just works the same way like GLB 2D. I recommend trying to understand it, its worth it, since its powerful!
If you really want to stick with the idea of an entity system, you can try one of the ES that got developed for GLB:
Gernots big ES
My small ESlite
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

SFguy

Thanks for the explanation, kanonet!

MrTAToad

I found it rather strange after using the 3D stuff in DBPro... You do get used to it though!

fuzzy70

Bigsofty's OpenB3D http://www.glbasic.com/forum/index.php?topic=6982.0 might be of use to you while you get used to GLB's way of doing things. It's windows only I believe & may not be any use to you but just in case I thought I will mention it.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

SFguy

Wow, good to know that such a program exists!

However, I'm interested more in programming now for the mobile platform rather than Windows. 

Thanks, Lee! :)