Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - ben_g

#166
Quote from: DJ Omnimaga on May 03, 2015, 06:16:14 AM
Ohai ben_g, long time no see :). Hopefully @TheMachine02 can help you there. Or maybe @matrefeytontias could help a bit if he looked into gLib before.

By the way is this for the 3D thing you used to work on several years ago?
Well, I've been more or less active on omnimaga lately, but I kind of forgot about this site. I'll try to be more active here too.

And this isn't really for anything I've already worked on (I'm mainly just trying stuff out, looking at what stuff I can get together), but I might pick up one of those projects when I can get enough things working.

Quote from: TheMachine02 on May 03, 2015, 09:19:43 AM
gVBOVertex(id) does only put the full-3d coordinate in the new gPositionX,Y,Z structure, and doesn't give screen position.
The gVBOPoint(id) does give the screen position (wich are now 1 byte) and the clipCode in hl.
The new gVBOGetData allow retrieve evrything in one pass though. the syntax is gVBGetData(destination_adress, size, offset, id), so I guess you most likely want to call it like that : gVBGetData(°GscreenX, 8, 0, id)
The screen coordinate will be in °GScreen, and the vertex coordinate in °GPosition. This is basically the "bottleneck" I  talked about. VBO are pretty badly implemented, and need a pretty much whole refactoring. gLib spent to much time in those vertex data manipulation  :P
So yeah, this is the current syntax, but that will most likely change.
Using GPosition seems to work, thanks.
#167
Screen coordinates are usually 3D, and the z coordinate indicates how far a point is from the screen.

gLib probably calculates points in all 3 dimensions (since that's how most 3D to 2D conversions work), but it either isn't returning it, or it's returning it with a different name.
#168
So, I've been playing around with this again.

I'm trying to add in billboards (using Matref's scaled sprites axiom), but I'm a bit stuck at calculating the scale.
I know that gVBOVertex(id) returns the coordinates of the point on the screen in {°GScreenX} and {°GScreenY}, but {°GScreenZ} doesn't exist, so I have no idea how I should calculate the distance between a point and the camera. Without the distance, I have no idea how I should calculate the scale.
Powered by EzPortal