BRL-CAD provides more than two dozen types of geometry ''primitives'' such as ellipsoids, boxes, and cones. Every primitive is described by a collection of callback functions, for example rt_ell_bbox() returns the bounding box dimensions for an ellipsoid. One of those functions describes a UV mapping of the object's surface, which is used for things like texture and bump mapping. An example of this is rt_ell_uv() in the src/librt/primitives/ell/ell.c source file for an ellipsoid. Several of our more complex primitive types (such as BoT, NMG, and BREP/NURBS) do not presently implement a UV-mapping function leading to unexpected runtime behavior.
References:
- http://en.wikipedia.org/wiki/UV_mapping
- src/librt/primitives/[PRIMITIVE]/[PRIMITIVE].c, read the rt_*_uv() function
Code:
- src/librt/primitives/extrude/extrude.c (implement the uv-mapping callback here)
- src/librt/primitives/table.c (add a reference to your function here)
- include/rtgeom.h
This task involves implementing a UV-mapping callback for any of the primitives that do not already have a functional UV-callback defined. Note that this is an advanced task that might take you more than a couple hours if you don't have solid coding skills, but it's ultimately just a few lines of code. See other primitives that already implement a UV-mapping callback for reference.
File name/URL | File size | Date submitted | |
---|---|---|---|
rt_extrude_uv.diff | 1.1 KB | December 14 2014 11:08 UTC |
I would like to work on this task.
This task has been assigned to Michael Huang. You have 100 hours to complete this task, good luck!
Michael,
I must admit that this is not a simple task. However, we're aware of the complexity and will credit you appropriately with however long it takes you to implement a solution. If the solution takes you more than a few hours, we can and will add additional tasks to reflect efforts to research an approach, implement the approach, test it, etc. Please keep track of how much time you invest and do ask questions if you get stuck on anything for more than 10 minutes.
Note we don't have a configurable UV mapping, so you just have to define one that works. ;)
I'll keep this in mind!
How might this UV mapping differ from the UV mapping used in rt_ebm_uv?
Would it be possible to just use the X and Y of hitp-hit_vpriv? rt_extrude_shot seems to generate hitp-hit_vpriv properly.
Hi, may I have an extension for this task? I'm certain I can finish it soon and would like another day to work on it. Thanks.
The deadline of the task has been extended with 1 days and 0 hours.
The work on this task is ready to be reviewed.
Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.
Congratulations, this task has been completed successfully.
Michael,
Sorry that I missed your question, but I wouldn't have had a quick and clear answer for you anyways. It's very possible that you needed is set there in vpriv and it's entirely possible that the uv mapping that will result is entirely useless. Still, you indeed did implement a uv-mapping callback and it compiles cleanly, so this task is done. We'll can create a follow-on tasks to demonstrate/validate that this works and/or to fix it if it's not adequate.
Regardless, thank you again. This indeed is one of the most complicated tasks we have this year, so really nice work figuring out what was needed!
A follow-on task to verify/validate that the implementation is correct has been posted: https://www.google-melange.com/gci/task/view/google/gci2014/4547822640693248