I'm new to 3d and struggling with how to handle the logic for the next step past the most basic 3d stuff.
An example - say I'm creating a racing game :
I create a racing track mesh in some 3d program. In blitz3d I load my track mesh and my buildings, my cars, signposts etc,give them x,y,z coordinates and position the entities.
Question 1) If you're modelling a large track, and there's lots of scenery changes etc, how do you handle loading the objects? I could create an array of types with coordinates and pointers to meshes etc but if I draw them straight away, the game will try to draw lots of objects simultaneously taking up heaps of memory, and trying to draw lots of things far out of visual range.
My guess is that you'd do something similar to evaluating the distance from the player to every object each game loop, and if distance < certain value then draw it somehow.
Assuming you take that approach, once you've drawn the object once, blitz will draw it automatically without you explicitly redrawing it every game loop - how do you then get rid of it?
Question 2) There's the track and objects etc on the screen and the player is driving their car around. Now they're sick of it and want to go back to the menu. How would you do a rapid deletion of all the objects so UpdateWorld doesn't show them anymore? When you have a cube or two like the examples, you can easily have global pointers for each object and delete them by name - once you have tens or hundreds of objects, that approach won't work anymore (unless you want 5000000 unique global variables- and that's not sensible)
Question 3) If your type (as described above) has fields like
ObjectType (Car/boat/sign/plane etc)
X
Y
Z
Pointer_to_mesh
How do you implement the pointer to mesh part of the type? I don't want individual meshes for each object of the same type, but if I copy the mesh it appears (from the doco) that changes to one entity will affect all the copies too.
Thanks for your time
Shane
An example - say I'm creating a racing game :
I create a racing track mesh in some 3d program. In blitz3d I load my track mesh and my buildings, my cars, signposts etc,give them x,y,z coordinates and position the entities.
Question 1) If you're modelling a large track, and there's lots of scenery changes etc, how do you handle loading the objects? I could create an array of types with coordinates and pointers to meshes etc but if I draw them straight away, the game will try to draw lots of objects simultaneously taking up heaps of memory, and trying to draw lots of things far out of visual range.
My guess is that you'd do something similar to evaluating the distance from the player to every object each game loop, and if distance < certain value then draw it somehow.
Assuming you take that approach, once you've drawn the object once, blitz will draw it automatically without you explicitly redrawing it every game loop - how do you then get rid of it?
Question 2) There's the track and objects etc on the screen and the player is driving their car around. Now they're sick of it and want to go back to the menu. How would you do a rapid deletion of all the objects so UpdateWorld doesn't show them anymore? When you have a cube or two like the examples, you can easily have global pointers for each object and delete them by name - once you have tens or hundreds of objects, that approach won't work anymore (unless you want 5000000 unique global variables- and that's not sensible)
Question 3) If your type (as described above) has fields like
ObjectType (Car/boat/sign/plane etc)
X
Y
Z
Pointer_to_mesh
How do you implement the pointer to mesh part of the type? I don't want individual meshes for each object of the same type, but if I copy the mesh it appears (from the doco) that changes to one entity will affect all the copies too.
Thanks for your time
Shane