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.

Dark GDK / Dot3D and Line3D source code + sample

Author
Message
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 18th Nov 2005 22:40
Hi there,

Here is the translated Dot3D and Line3D from Cloggy's d3dfunc.dll:

d3dfunc.h :



3d3func.cpp :



And sample code:



The code works fine at the example. 3D dots appear in red.

However, I have a couple of issues and if somebody has any clue, I would be grateful. I inserted the functions in a big project so I don't know exactly what's wrong, but:

1 - 3D Lines do not obey ZENABLED flag, they appear over any 3d object.
2 - 3D Dots do not appear as dots, but as squared sprites.

I'm stuck finding out the reasons why.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Nov 2005 14:13
Quote: "3D Dots do not appear as dots, but as squared sprites"


I had this exact same problem when I was trying to do a plugin - never solved it When you find out, let me know.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 21st Nov 2005 18:17
I've done all kind of test, and I don't even know the reason. I cannot even force it to work wrong with examples.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 14th Dec 2005 15:38
Ian, in this case there is a problem with in-built particles that affects 3d dots. Something about a variable name that was already in use.

Also, 3d line zenable problem seems to be related with dbLockObjectOn.

I'll post an update soon, hopefully.
Scilynt
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 14th Dec 2005 17:33
According to Cloggy the problem was with Make Particles changes the point size. To fix it add this to the rest of the render state changes in the Dot3D function.



I set it up to pass an extra parameter, a float fSize, but you can use 1.0f if you want the default.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 14th Dec 2005 18:26 Edited at: 14th Dec 2005 18:30
SilentS, great!

Now I discovered that 3d dots also have that zenable problem with locked objects
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Dec 2005 21:01 Edited at: 14th Dec 2005 21:45
morcilla,

I noticed you have a call in the d3d_line3d function to set


What happens when this is commented back in?

It's just that I've used D3DSpy to look at whats happening and when the line/dot is drawn D3DRS_ZWRITEENABLE is set to false. I think this should be true.

EDIT - BTW it is disable object zwrite that appears to be the problem when locking objects, not lock object itself I think.

EDIT 2 - Can't see what zwrite enable actully achieves. I don't think it's needed, doesn't seem to have any effect other than stop d3d commands functioning properly. BTW the code I queried was in my original (getting old and going blind) It doesn't have an effect.

Cheers,

Cloggy
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 15th Dec 2005 12:04
Quote: "What happens when this is commented back in?
"

Nothing! I've done a lot of tests.

Quote: "
it is disable object zwrite that appears to be the problem when locking objects, not lock object itself I think"


Well, below is the setup of the object that causes the problem. I commented the line:


And the problem persist if the object is still locked.

This is the full object setup that causes zenable to fail (so everybody knows what are we talking about):

Login to post a reply

Server time is: 2024-05-06 21:53:08
Your offset time is: 2024-05-06 21:53:08