-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requesting example of how to load/draw a model #10
Comments
Sorry for that. |
The issue here might just be that the
|
Sorry to bump an old thread, butt the problem is still exist. I managed to find a way to draw a model, by replacing (defcstruct (%model :class model-type)
"Model type"
(transform (:struct %matrix))
(mesh-count :int)
(material-count :int)
(meshes (:pointer (:struct %mesh)))
(materials (:pointer (:struct %material)))
(mesh-material (:pointer :int))
(bone-count :int)
(bones (:pointer (:struct %bone-info)))
(bind-pose (:pointer (:struct %transform))))
(define-conversion-into-foreign-memory (object (type model-type) pointer)
(with-foreign-slots ((transform mesh-count material-count meshes materials mesh-material bone-count bones bind-pose) pointer (:struct %model))
(setf transform (cffi:convert-to-foreign (nth 0 object) '(:struct %matrix)))
(setf mesh-count (nth 1 object))
(setf material-count (nth 2 object))
(setf meshes (nth 3 object))
(setf materials (nth 4 object))
(setf mesh-material (nth 5 object))
(setf bone-count (nth 6 object))
(setf bones (nth 7 object))
(setf bind-pose (nth 8 object)))) |
When I try to load and draw a simple model, such as in this example, I get pointer errors in
(draw-model)
:This works in C so at least on some level I am using the library correctly. Do you have a working Lisp example? Am I doing something wrong or is this related to #3?
The text was updated successfully, but these errors were encountered: