Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Positioning objects on an X file map. Need Help!!

Author
Message
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 4th Jun 2004 14:51
Basically I know what I want but im not sure how to implement it...
Ive built an island and I now want to start to populate it with objects. Rather than loading the objects and positoning them by hand Im going to create a single poly and position it on my island, aligning it to the surface. This would then be the position for my tree. I will then copy this poly many times basically creating a poly object map that tells me where all the trees should be positioned. I then must export this file as treepostionmap.x . How would i go about reading this into DBpro and instancing the trees onto all the polys positions? I need to be able to read from the file how many polys there are, instance the tree models that many times and position/orientate the trees onto all the polys in the map.
It would also be nice if it could be expanded so that I could have other object types in this file later on.
Any help would be appreciated. Thanks Monkee
Nightmairs
21
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Bradford, UK
Posted: 4th Jun 2004 17:15
Im facing the same delemma except just recently ive been using 3DS max to create a scene for all the static object and then use DBPRO to place all the objects that represent a major role in the game. Water pools and other water like object I use seperate meshes. Sorry if this post didn't help

-= I am the Alpha and the Omega =-
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 4th Jun 2004 20:13 Edited at: 4th Jun 2004 20:15
If each poly placeholder is exported as a separate limb, you could use the limb checklist commands to build a list of limbs and their positions.






Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Jun 2004 01:49
Why not just use the tree model instead from the start?

"eureka" - Archimedes
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Jun 2004 01:53
Why not use limbs on the main object

Enumerate them after loading it. You can then get the position, and depending on the name, you'll know what it is.


The place for wonderful plug-ins and things.
Keep your friends close, and your cats even closer.
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 5th Jun 2004 17:40
Thanks for your help david t. Would that method read the polys angle aswell?
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Jun 2004 17:34
Please expand on that coding area. You mean export the island with all the place holder polys on then use the limb command to get the postion/angle somehow? Could you please show me some sample code?

@phaelax: The reason why I dont want to use the tree model copied lots of times is because instancing the tree is far better and more memory efficient.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Jun 2004 18:23
He means that you use PERFORM CHECKLIST FOR LIMBS on the object, then use the CHECKLIST STRING$ function to get the names that you've assigned to each limb.

The only problem with this method is that you are limited to a total of 254 limbs - the first limb is the origin of the object.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Jun 2004 06:48
But if you're replacing all those tree instances with actual tree models after the program loads, then its not really any more efficient. Unless you mean you're only display a few trees at a time.

"eureka" - Archimedes
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 7th Jun 2004 13:32
All the models placed on the poly placeholders would be instances rather than copys so it would be more efficient as an instance is a referenced version of the original. There would only be one mesh loaded. Its they way we did things on a Ps2 game I was working on the other year. If I had a hundred or so trees then I would only load in 1 20k mesh rather than having 100 or so copys (2 meg of meshes).
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Jun 2004 13:35
Ah, I get what you're saying now. What if you made a seperate text file, containing all the placement coordinates. Then just read that in with the corresponding map.

"eureka" - Archimedes
monkee
22
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 8th Jun 2004 12:48
Would be cool if there was a script for max that would generate a file that has all the coordinates of the selected objects...
If I've got over a hundred trees I dont really fancy doing that by hand.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Jun 2004 03:00
well, you can get limb coordinates in db. So, use a cube or something in Max to represent a tree. Keep track of the limb number range. Write a short program to load the model, and write the coordinates of each of those limbs to a text file.

"eureka" - Archimedes

Login to post a reply

Server time is: 2025-06-06 09:47:27
Your offset time is: 2025-06-06 09:47:27