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.

Work in Progress / Basic3DDebugDKEnh - Low-Level vertex manipulation TCP

Author
Message
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 14th Sep 2004 22:52 Edited at: 27th Sep 2004 22:48
TPC library url: http://www.dannywartnaby.co.uk/rgt/attachments/DKShop.zip
Basic3D example url: http://www.dannywartnaby.co.uk/rgt/attachments/LowLevVertExamples.zip
Camera3D exmaple url: http://www.dannywartnaby.co.uk/rgt/attachments/Camera3DEnExample.zip

This freeware TPC library gives you access to low-level vertex manipulation and to some object and camera properties.

Command list.

Basic3D

This part of commands work directly with object internal data.

Return Integer=DK GET LIMB COUNT(Object Number)
Return Integer=DK GET OBJECT FVF(Object Number)
Return Integer=DK GET LIMB VERTEX COUNT(Object Number, Limb Number)
DK CALCULATE POLY NORMALS Object Number, Point1 X, Point1 Y, Point1 Z, Point2 X, Point2 Y, Point2 Z, Point3 X, Point3 Y, Point3 Z
Return Float=DK GET PICK VECTOR X()
Return Float=DK GET PICK VECTOR Y()
Return Float=DK GET PICK VECTOR Z()
Return Float=DK GET PICK DISTANCE()
Return Integer=DK GET OBJECT WIREFRAME(Object Number)
Return Integer=DK GET OBJECT CULL(Object Number)
Return Integer=DK GET OBJECT LIGHT(Object Number)
Return Integer=DK GET OBJECT AMBIENT(Object Number)
Return Integer=DK GET OBJECT FOG(Object Number)
Return DWORD=DK GET VERTEX DATA(Object Number, Limb Number, Vertex Number, IndexData)
Return Float=DK GET VERTEX POSITION X(Object Number, Limb Number, Vertex Number)
Return Float=DK GET VERTEX POSITION Y(Object Number, Limb Number, Vertex Number)
Return Float=DK GET VERTEX POSITION Z(Object Number, Limb Number, Vertex Number)
DK SET VERTEX DWORD DATA Object Number, Limb Number, Vertex Number, IndexData, Value
DK SET VERTEX FLOAT DATA Object Number, Limb Number, Vertex Number, IndexData, Value
DK SET VERTEX POSITION Object Number, Limb Number, Vertex Number, X, Y, Z
DK CONVERT LIMB MESH TO VERTS LIST Object Number, Limb Number

This part of commands work with vertex data buffer.

VB LOCK VERTEX DATA FOR LIMB Object Number, Limb Number
VB LOCK VERTEX DATA FOR MESH Mesh Number
VB UNLOCK VERTEX DATA
VB SET VERTEX DATA POSITION Vertex Number, X, Y, Z
VB SET VERTEX DATA NORMALS Vertex Number, X, Y, Z
VB SET VERTEX DATA DIFFUSE Vertex Number, Value
VB SET INDEX DATA Index, Value
VB SET VERTEX DATA UV Vertex Number, U, V
VB SET VERTEX DATA SIZE Vertex Number, Value
VB ADD MESH TO VERTEX DATA Mesh Number
VB DELETE MESH FROM VERTEX DATA ValueA, ValueB, ValueC, ValueD
Return Integer=VB GET VERTEX DATA VERTEX COUNT()
Return Integer=VB GET VERTEX DATA INDEX COUNT()
Return Float=VB GET VERTEX DATA POSITION X(Vertex Number)
Return Float=VB GET VERTEX DATA POSITION Y(Vertex Number)
Return Float=VB GET VERTEX DATA POSITION Z(Vertex Number)
Return Float=VB GET VERTEX DATA NORMALS X(Vertex Number)
Return Float=VB GET VERTEX DATA NORMALS Y(Vertex Number)
Return Float=VB GET VERTEX DATA NORMALS Z(Vertex Number)
Return Float=VB GET VERTEX DATA DIFFUSE(Vertex Number)
Return Float=VB GET VERTEX DATA U(Vertex Number)
Return Float=VB GET VERTEX DATA V(Vertex Number)

Camera3D

Return Float=DK GET CAMERA FOV(Camera Number)
Return Float=DK GET CAMERA NEAR(Camera Number)
Return Float=DK GET CAMERA FAR(Camera Number)
Return Integer=DK GET CAMERA VIEW X(Camera Number)
Return Integer=DK GET CAMERA VIEW Y(Camera Number)
Return Integer=DK GET CAMERA VIEW WIDTH(Camera Number)
Return Integer=DK GET CAMERA VIEW HEIGHT(Camera Number)
Return Float=DK GET CAMERA ASPECT(Camera Number)
DK CONVERT 3D TO 2D Camera Number, X, Y, Z
DK CONVERT 2D TO 3D Camera Number, X, Y, Distance



Planned commands in shareware version:

Basic3D

Return Float=ADVANCED INTERSECT OBJECT(Object Number, X, Y, Z, ToX, ToY, ToZ)
Return Integer=PICK OBJECT(Camera Number, Screen X, Screen Y, Object Start, Object End)
Return Integer=GET PICK POLY()
APPLY MATRIX4 TO LIMB Object Number, Limb Number, Matrix4

Matrix

Return Float=Intersect Matrix(MatrixNum, X, Y, Z, ToX, ToY, ToZ)
Return Integer=Pick Matrix(CameraNum, Screen X, Screen Y, Matrix Start, Matrix End)
Convert Matrix To Object MatrixNum, ObjectNum

3DSprite

Make Object 3DSprite ObjectNum, X, Y, Width, Height
Text In 3DSprite 3DSpriteNum, X, Y, Text$
Line In 3DSprite 3DSpriteNum, X1,Y1,X2,Y2
Dot In 3DSprite3D SpriteNum, X, Y
Paste Image In 3D3DSprite, SpriteNum, X, Y, ImageNum
Box In 3DSprite 3DSpriteNum, Left, Top, Right, Bottom
Point In 3DSprite 3DSpriteNum, X, Y
CLS In 3DSprite 3DSpriteNum
Resize 3DSprite 3DSpriteNum, X, Y, Width, Height
Return Integer=3DSprite Width(3DSpriteNum)
Return Integer=3DSprite Heigth(3DSpriteNum)
Return Integer=3DSprite Position X(3DSpriteNum)
Return Integer=3DSprite Position Y(3DSpriteNum)
Return Integer=3DSprite Depth(3DSpriteNum)
Return Integer=Pick 3DSprite(CameraNum, Screen X, Screen Y, 3DSprite Start, 3DSprite End)

P.S. Sorry for my English.

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
Humanoid
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Finland
Posted: 14th Sep 2004 23:58
keyword file missing.


Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 15th Sep 2004 00:55
Dmitry,

I think the command nemes are just fine. They are very self explanatory. Looks like a very nice plugin!

EZrotate!
Tokamak Physics Wrapper!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 15th Sep 2004 22:12
Yes, and it'll make DrakeX happy because he's been asking for low level vertex manipulation functionality for ages.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Sep 2004 22:59
me and wolf can enhance our memblock terrains now. once that little command is fixed.

"eureka" - Archimedes
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 15th Sep 2004 23:21
Hmm... not sure if that speed drop is encouraging.
how exactly are you getting around not locking and unlocking the vertex buffer?


Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 20th Sep 2004 23:11
I have fixed some bugs with Set Vertex... commands.

New examples for updated TCP. http://www.dannywartnaby.co.uk/rgt/attachments/LowLevVertExamples.zip

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 24th Sep 2004 03:50
Added few more commands for Camera3D. All of them work well with scaled viewports and multiple cameras.

Return Float=DK GET CAMERA FOV(Camera Number)
Return Float=DK GET CAMERA NEAR(Camera Number)
Return Float=DK GET CAMERA FAR(Camera Number)
Return Integer=DK GET CAMERA VIEW X(Camera Number)
Return Integer=DK GET CAMERA VIEW Y(Camera Number)
Return Integer=DK GET CAMERA VIEW WIDTH(Camera Number)
Return Integer=DK GET CAMERA VIEW HEIGHT(Camera Number)
Return Float=DK GET CAMERA ASPECT(Camera Number)
DK CONVERT 3D TO 2D Camera Number, X, Y, Z
DK CONVERT 2D TO 3D Camera Number, X, Y, Distance

Camera3D example url: http://www.dannywartnaby.co.uk/rgt/attachments/Camera3DEnExample.zip

Post away if you have any suggestions for additional features of this TPC library.

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 24th Sep 2004 09:20
this is a REALLY impressive TPC!!!! fantstic work!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 27th Sep 2004 22:50
I have decided to rename library to DKShop and release it in the current condition as freeware. All other works above additional commands will proceed above the shareware version.

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 27th Sep 2004 23:44
Dmitry,
Can I ask, how did you access this information? Did you find out where the object data is stored in memory from withing DBP?

Or did you decompile the old dll's for DBP and just mimik their commands?

Just curious, as I have often wondered how you would find where in memory the object data is stored

PS figured I'd post here so I didn't mess up your Prog Announcememnt thread

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 27th Sep 2004 23:53
?GetInternalData in DBProBasic3DDebug.dll return a pointer on object data. Same thing with ?GetInternalData in DBProCameraDebug.dll.

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 28th Sep 2004 00:57
more importantly, how did you figure out the data format? are they using a standard DirectX struct, or something custom... I'd love to know how you figured that part out!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 28th Sep 2004 01:00
Ah, damn, that simple eh?

Well, it's nice to know that you figured it out

Good job.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 28th Sep 2004 01:42
Quote: "more importantly, how did you figure out the data format? are they using a standard DirectX struct, or something custom... I'd love to know how you figured that part out!!"


Something custom. I asked Mike about internal structure of object, but he has not answered me. So I decompiled dll, and began to search for the information on structure of object data. I hope in the near future TGC will give us full SDK.

Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP
psyvariar
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location:
Posted: 30th Sep 2004 21:26
I'd like to get to know all this deep 3D functions stuff. Am I right in thinking that using vertex buffers will be faster than the other method? If anyone can supply some example code I'd be grateful, particularly for getting vertex position data from an objects vertices. For example, morphing from one object to another (say 2 cubes with identical vertex count), which approach would be best, the DK commands or the VB ?

Login to post a reply

Server time is: 2024-11-22 17:34:37
Your offset time is: 2024-11-22 17:34:37