markb | 28 Apr 2013 00:32
Picon

Sample code for vertex arrays

Can anyone provide sample code using vertex arrays?

The program varray.lisp in the redbook examples uses these but things like gl:vertex-pointer do not
appear to be exported into the cl-opengl package.

cage | 10 Mar 2013 14:35

slow interpolation issues

Hello,

I have written an MD2 3d mesh loader, everything works fine except for
the animations.

Because  the model  save only  the key  frame for  each  animation the
loader  must interpolate  the vertex  position of  the mesh  to  get a
smooth animation.

My solution was to save the  triangles vertices in a gl-array for each
frame an then doing linear interpolation, something like that:

(defun lerp-gl-array (a b c count interpolation-factor)
  (dotimes (i count) 
    (setf (gl:glaref c i) 
      (alexandria:lerp interpolation-factor (gl:glaref a i) (gl:glaref b i)))))

but it seem to be too slow as shown by the SBCL profiler

  seconds  |     gc     |     consed    | calls |  sec/call  |  name  
-----------------------------------------------------------
   264.554 |      8.189 | 8,307,049,792 | 2,870 |   0.092179 | CL-GL-UTILS:LERP-GL-ARRAY
-----------------------------------------------------------
   264.554 |      8.189 | 8,307,049,792 | 2,870 |            | Total

is this my fault? Any idea how can I improve performance?

Thank you.
C.

(Continue reading)

Luís Oliveira | 28 Jan 2013 22:15
Picon
Gravatar

glop

Hello,

This project is potentially interesting for cl-opengl users:
<https://github.com/patzy/glop>. Has anybody tried it out?

Cheers,

--

-- 
Luís Oliveira
http://r42.eu/~luis/
Nick Khamis | 27 Dec 2012 01:58
Picon

package "GL" not found

Hello Everyone,

My current environment consists of (Emacs, SBCL, ASDF, and SLIME).
Trying to run a few minimalistic examples I keep getting:

package "GL" not found

Things I have done to try to make ASDF central registry aware of the
cl-opengl implementation:

#~/.sbclrc

;;; asdf-prep.lisp
(dolist (subdir (list ;; ... some other packages ...
                      #P"cl-opengl/"))
  (push (merge-pathnames subdir #P"/usr/local/tools/")
        asdf:*central-registry*))

And in the code I added:

(require :asdf)                 ; need ASDF to load other things
(asdf:load-system :cl-opengl)   ; load OpenGL bindings
(asdf:load-system :cl-glu)      ; load GLU bindings
(asdf:load-system :cl-glut)     ; load GLUT bindings

I have heard of quicklisp however, trying to understand how
environment variables work, and would like to get it going with
this minimalistic setup first if possible.

Your help is greatly appreciated,
(Continue reading)

Zach Hall | 7 Aug 2012 15:02
Picon

cl-glut not able to open windows until shown how by lispbuilder-sdl

Hi everyone,


I'm having a weird problem with cl-glut.

When I run something using glut to produce a window, I don't get a window. Inserting a swank-handler into the loop of the examples, I determined that they WERE running, they just weren't giving me a window.

I'm using Windows 7, Clozure-CL and I have FreeGlut loaded and detected properly. Everything works, except that the window doesn't show.

So! I decided to try Lispbuilder-SDL, I loaded up their examples and they are able to successfully open windows.

What's really odd about this, is that AFTER I've created a window using Lispbuilder, it seems to show Glut what to do, and Glut can suddenly open display windows properly.

Does anyone have any idea what could be causing this?
_______________________________________________
cl-opengl-devel mailing list
cl-opengl-devel <at> common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cl-opengl-devel
John Crawford | 4 Aug 2012 19:58
Favicon
Gravatar

Re: How to install/run the demo code? Successful.

 > You need FreeGLUT rather than classic GLUT.

Thanks, that was the last piece of the puzzle. For the record, the 
entire set of steps I went through was:

File->Load-> C:\Lisp\Tools\quicklisp.lisp - only needs to be done once.
or
CL-USER 1 : 1 > (load #p"C:/Lisp/Tools/quicklisp.lisp")

CL-USER 1 : 1 > (quicklisp-quickstart:install) - only needs to be done once.

CL-USER 2 > (load #p"c:/documents and settings/username/quicklisp/setup.lisp")
needs to be done every time in LispWorks Personal Edition, which 
doesn't support init files.

CL-USER 3 : 1 > (ql:quickload :cl-opengl)

CL-USER 4 : 1 >  (ql:quickload :cl-glut-examples)

CL-USER 5 : 1 >  (cl-glut-examples:list-examples)
CL-USER 6 : 1 >  (cl-glut-examples:gears)
Luís Oliveira | 3 Aug 2012 20:48
Picon
Gravatar

Fwd: How to install/run the demo code?

(ups. Also forgot to Cc the list.)

---------- Forwarded message ----------
From: Luís Oliveira <luismbo <at> gmail.com>
Date: Fri, Aug 3, 2012 at 4:02 PM
Subject: Re: [cl-opengl-devel] How to install/run the demo code?
To: John Crawford <cyclops <at> speakeasy.net>

On Fri, Aug 3, 2012 at 2:42 PM, John Crawford <cyclops <at> speakeasy.net> wrote:
> How do I install and run the demo code? I'm running Lispworks PE 6.01 on
> Windows, I've installed quicklisp and ran: (ql:quickload "cl-opengl") which
> seemed to download the library. But so far I haven't managed to run the demo
> examples. Thanks.

(ql:quickload "cl-glut-examples") loads the examples.

(cl-glut-examples:list-examples) lists the available examples which
you can run individually.

There's also a run-examples function which runs all examples simultaneously.

HTH,

--
Luís Oliveira
http://r42.eu/~luis/

--

-- 
Luís Oliveira
http://r42.eu/~luis/
John Crawford | 3 Aug 2012 15:42
Favicon
Gravatar

How to install/run the demo code?

How do I install and run the demo code? I'm running Lispworks PE 6.01 
on Windows, I've installed quicklisp and ran: (ql:quickload 
"cl-opengl") which seemed to download the library. But so far I 
haven't managed to run the demo examples. Thanks.

John C>
John Crawford | 2 Aug 2012 22:54
Favicon
Gravatar

Documentation status?

Looking back through the archives, I see a post in 2010 about the 
documentation not yet having created. Is that still the case? If it 
*does* exist (or can be created), how/where would it be? Thanks.

John C>
Chris Bagley | 19 Jul 2012 14:39
Picon

gl-array count

I've been slowly getting my head round the gl-array macros and there is one last thing that is confusing me

In this struct, size is set to the type of unsigned byte...why? It seem that this stores the length of the foreign array which, as far as I can tell from CFFI doco, is an integer.

(defstruct (gl-array (:copier nil))
  "Pointer to C array with size and type information attached."
  (pointer (null-pointer))
  (size 0 :type unsigned-byte)
  (type nil :type symbol))

There's probably something I'm missing and if anyone can explain that would be great!
Thanks folks
_______________________________________________
cl-opengl-devel mailing list
cl-opengl-devel <at> common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cl-opengl-devel
Chris Bagley | 16 Jul 2012 11:58
Picon

Thanks to all

In open source software it can often seem that not many people are using what you are creating. So as one of the silent lurkers around these parts I just want to say thank-you.
I have only recently got into common lisp and cl-opengl has given me a chance to have something FUN to put my efforts into. It can be hard to get enthused about some of the more esoteric sides of lisp, but when it goes into upping frame rates or making virtual explosions suddenly the reason for studying it seems obvious!

So aye, thanks for all your work, hopefully I'll have something playable soonish.
Cheers
Baggers

_______________________________________________
cl-opengl-devel mailing list
cl-opengl-devel <at> common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cl-opengl-devel

Gmane