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 / Surface Normals For My Rook Piece

Author
Message
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 7th Feb 2014 21:26 Edited at: 8th Feb 2014 02:16
Hello DBPeeps!

I'm trying to make a crude 3D chess set out of primitives.
I've done a Pawn and Bishop so far, now I'm onto the Rook...

I used PERFORM CSG DIFFERENCE to add the crenelations but the problem is they appear to be taking light from the opposite side of the rest of the object.


(On second glance, this Rook appears to suffer from Anorooxia, judging from how skinny he is. )

Does anyone know how I can tweak this process to make it behave properly?



wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 7th Feb 2014 22:00
Try changing the object cull. I think that's the problem.

New sig coming soon..
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 7th Feb 2014 22:17 Edited at: 7th Feb 2014 22:18
Quote: "Try changing the object cull. I think that's the problem."


Wow... that did it! Thanks Watty!

I had no idea that the cull setting could affect the object's lighting... not sure I understand why turning off culling does that.

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 7th Feb 2014 22:25
Quote: "I used PERFORM CSG DIFFERENCE"

Wow, this even works? Never works for me for years.

All your TGC are belong to us.
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 7th Feb 2014 23:04 Edited at: 8th Feb 2014 02:27
Quote: "Wow, this even works? Never works for me for years."


I can usually get a good result if I use CONVERT OBJECT FVF n,338 on both my brush and main objects. The results do vary depending on the shapes I'm working with, though.



Depending on the brush (maybe the object too) it may add pieces of the brush rather than subtract pieces from the main object. Sometimes this is what we want, though, as in the case of my anorexic rook.

SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 7th Feb 2014 23:24 Edited at: 7th Feb 2014 23:25
Weird, perform csg difference and all the other commands have always been really buggy for me too, but I noticed you converted the object FVF to 338... Do they need to be that format to work properly? That could explain why they almost never cooperate for me

Edit: Oh, ok, you beat me to it!
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 8th Feb 2014 01:45 Edited at: 8th Feb 2014 01:57
Quote: "That could explain why they almost never cooperate for me"


Yeah, I got lucky and stumbled upon the "338" part of the command while researching vertex data commands here in the forums. Admittedly, I'm not hip to what the 338 format is (I have no understanding of DWORDs yet) but I'm guessing it re-indexes the triangles or something to that effect.

I would love to see a well-defined list of all of convert object fvf's capabilities. I already made a sweet arched doorway using the top half of a (prone) cylinder deformed with scale object!

Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 8th Feb 2014 04:08 Edited at: 8th Feb 2014 04:09
Chris Tate's site has a good article that illustrates the difference between fvf274 (the default) and fvf338

in essence, all it does is include a dword for vertex colour information on top of the 274 format (vertex x,y,z coords, x,y,z normals, and uv coordinates) - so I am not sure why 338 would be better for csg operations, but hey, if it works...

the msdn site has a lot of info regarding the fvf variables here

This is not the sig you are looking for....
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 8th Feb 2014 15:36 Edited at: 8th Feb 2014 15:45
Great info, thanks Dia!

Quote: "Chris Tate: The next FVF 338 vertex data is a DWORD that contains the diffuse colour of the vertex, this is missing from FVF 274""


Vertex diffuse is exactly what I was studying when I first saw 338.
So I guess it's an indexing/sequencing issue after all?



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Feb 2014 00:22
@Derek Darkly
Now you need a chess pawn.



I'm not a grumpy grandpa
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 9th Feb 2014 01:04
Quote: "Now you need a chess pawn"


Ha! Great Chafari... it looks way better than what I made.
Just so happens I was experimenting today with tapering cylinders too!

Login to post a reply

Server time is: 2026-07-07 00:09:40
Your offset time is: 2026-07-07 00:09:40