need help creating database to use with script

thanks electroburger
but i will wait until 3DC can get oreintation DirX, DirY, DirZ, UpX, UpY, UpZ in time

many thanks anyway

bye

Hi

Since in the actual version of 3DC you can’t get oriention in time needed to create animation script for predifined objects as human, cars, moto, bike, etc

Is it possible to gave me the codes i will need to use to create a database.

if possible of the kind

Dim Ori(450000,9)
for x = 1 to 450000
Ori(x,1) = DirX
Ori(x,2) = DirY
Ori(x,3) = DirZ
Ori(x,4) = UpX
Ori(x,5) = UpY
Ori(x,6) = UpZ
Ori(x,7) = orientation X
Ori(x,8) = Orientation Y
Ori(x,9) = orientation Z
Next

Thanks

I just started using 3DS and want to build trains, and tackling animation is about the last thing on my mind. Actually no, some day soon I may want to animate pantographs.

Be that as it may, I have done quite a bit of ADO (ActiveX Data Objects) so far and played around once with ASP (Active Server Pages) – that is also based on VBScript and thus is nearly the same, as far as database access goes.

Assuming you just want to write records to a database, the simplest possible VBScript to do that would look something like this:

option explicit
dim db

set db = CreateObject(‘ADODB.Connection’)
db.Open(‘Provider=Microsoft.Jet.OLEDB.4.0;Data Source=’ and ‘C:testdb.mdb’)

for x = 1 to 450000

(get the next values of dirx, diry, dirz, etc. here)

db.Execute ‘insert into anitable (idx, dirx, diry, dirz, upx, upy, upz, orix, oriy, oriz) ‘ and _
‘values ( ‘ and x and ‘ , ‘ and dirx and ‘ , ‘ and diry and ‘ , ‘ and dirz and _
‘ , ‘ and upx and ‘ , ‘ and upy and ‘ , ‘ and upz and _
‘ , ‘ and orix and ‘ , ‘ and oriy and ‘ , ‘ and oriz and ‘ )’

next x

db.Close
Set db = Nothing

For this example, I assumed an Access database called ‘C:testdb’ containing one table, ‘anitable’.

In Access, define ‘Anitable’ to have all the fields mentioned in your example, like dirx, I imagine they should be double and not integer or smallint. You should also add the loop counter in your example as at least a field in the table, if not a primary key. Otherwise order of the records when you go to read the table is not guaranteed. I also think that to get started, you would want to create the database outside of the script.

If you want to clear out the table prior to running the script, simply add the line

db.Execute ‘delete from anitable’

after db is created but before the loop.

Hope this is what you need.

You must be logged in to reply in this thread.

3 posts