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.

Newcomers DBPro Corner / Draw3DLine ( X1,Y1,Z1,X2,Y2,Z2)

Author
Message
Survey
16
Years of Service
User Offline
Joined: 2nd Sep 2008
Location: WA Australia
Posted: 3rd Sep 2008 05:09
Is there a better way to create lines and also points in 3d.
egraw3DLine( X1,Y1,Z1,X2,Y2,Z2)




` This code was downloaded from The Game Creators
` It is reproduced here with full permission
` http://www.thegamecreators.com

function makeLine3D(number, x#, y#, z#, tox#, toy#, toz#)
make object triangle number, x#, y#, z#, x#, y#, z#, tox#, toy#, toz#
set object wireframe number,1
endfunction





` This code was downloaded from The Game Creators
` It is reproduced here with full permission
` http://www.thegamecreators.com

function Draw3DLine(obj, X1,Y1,Z1,X2,Y2,Z2)
` the obj must be a tri. or failure will result
if OBJECT EXIST(obj)
LOCK VERTEXDATA FOR LIMB obj,0
SET VERTEXDATA POSITION 1, X1, Y1, Z1
SET VERTEXDATA POSITION 2, X2, Y2, Z2
SET VERTEXDATA POSITION 3, X2, Y2, Z2
UNLOCK VERTEXDATA
SET OBJECT WIREFRAME obj, 1
`Cgreen1 is just a image of one color in case you need texture /color the line
TEXTURE OBJECT obj, Cgreen1
else
MAKE OBJECT TRIANGLE obj, X1, Y1, Z1, X2, Y2, Z2, X2, Y2, Z2
SET OBJECT WIREFRAME obj, 1
TEXTURE OBJECT obj, Cgreen1
endif
endfunction

Sean
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Sep 2008 16:42 Edited at: 3rd Sep 2008 16:44
If you don't mind it being a 3D object, then try this (untested):



And you simply call it like this:


BlobVanDam
16
Years of Service
User Offline
Joined: 26th Jul 2008
Location: one of Cybertrons moons
Posted: 3rd Sep 2008 16:44
I might be crazy, but I recall there might be a 3rd party dll someone made that allowed you to draw proper hardware 3D lines. It was a dll that added many extra directx commands, but points and lines is all I remember. Can't find it either, but I'll keep looking, even if just to prove I'm not nuts
BlobVanDam
16
Years of Service
User Offline
Joined: 26th Jul 2008
Location: one of Cybertrons moons
Posted: 3rd Sep 2008 16:49
http://www.cloggj.f2s.com/DBPro2/d3dfunc.html

Found it. This should work, although I have never tried it
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 3rd Sep 2008 19:02
it does work, ive used it in many of my projects.

Login to post a reply

Server time is: 2024-11-15 22:09:44
Your offset time is: 2024-11-15 22:09:44